c# - Usercontrol set TextBox text for other usercontrol -


I have two different user control classes. I have to set a text box text by another usercontrol for a usercontrol I am trying to work on my property but nothing sets up. How to solve it? I posted the code snippets given below.

Event Category Search Control. Cs

  Event category control of public partial control: User control (Private Zero DataGrid viewGrade client (Object sender, Data grid view call align ARGS E) {eventCategoryChange incCatChange = Change new Events category () ; //textbox1.Text = incCatChange.TextBoxCategory; // work incCatChange.TextBoxCategory = "test"; // does not work}}   

Change event category

  Change the Public Partial Classroom Event Category: User Controls {Change the public event category () {initializeComponent ();} public string text box category {return {return event} category tag box. Text;} set {eventCategoryTextBox.Text = value;}}}    

The value you get is the default value, because you have created There is only one line before Change event category , so both the recipient and setter are not working.

One possibility to communicate, which is TextBox (or any other property)

For example, for example, the constant property (this is only an example of that user control , but this idea is very simple to display):

  Change the Public Partial Classroom Event Category: User Control [Public Stable Event] Mr. Change Example {get; Private set;} Change the public event category () {Initial group (); Example = this; } Public string text box category {Back {return event} Category tag box. Text; } Set {eventCategoryTextBox.Text = value; }}}   

You can now

  event category.Instance.TextBoxCategory = "test";   

Another solution would be to use events (see the question). Change event category Change the value of other user controls Change the value to the class value (string) and TextBox in the event handler.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -