Well folks, I'm developing a system, and in that system I need to pass the customer's name to a text box that is on another form, that is, TxtCliente must be public, so that I could go to the main form and put : TxtCliente.Text = Value X; but what happens is that I can't seem to make this text box public, because I've done everything and it doesn't appear in other forms than yours, everything is attachedenter image description here however, I cannot pull it from another form.
Asked
Active
Viewed 66 times
0
-
Create a service class that these to forms share the same instance of. When the text changes in one form it is sent to this shared class which publishes an event that the other form is listning to and changes its textbox. – Michael Jan 21 '21 at 20:42
-
From docs: [Pass data between forms](https://learn.microsoft.com/en-us/visualstudio/data-tools/pass-data-between-forms?view=vs-2019) – Fabio Jan 21 '21 at 21:05
1 Answers
0
I think you have to use ActiveForm property. You may post the fragment of code that you're trying to do. Refer to this solution. How to access one form's property from another?

Aung
- 313
- 3
- 9