Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update Child controls
Message
 
À
22/05/2009 18:37:39
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Application:
Desktop
Divers
Thread ID:
01401615
Message ID:
01401623
Vues:
28
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform