Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Child controls
Message
 
To
22/05/2009 18:37:39
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Application:
Desktop
Miscellaneous
Thread ID:
01401615
Message ID:
01401623
Views:
27
>I have a user control added to a control to a control ... to a parent form. In the parent form code, I am reading a file and need to put the results of the file in a text box of my user control. So far the only way I have been able to see the control from the main form is to make it public.
>
>Is there a better way to expose the control to the parent form?

Create a public property on the user control. In it's set method set the internal control's value, ex.
public string Text
{
   set { this.txtSubControl.Text = value; }
   get { return this.txtSubControl.Text; }
}
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform