| duck123 wrote: |
| I create a user controls and added it on a Form. There are also an textBox on the same Form.
But i can't assign an text string to the textBox on the Form by codding in the user control .
How could i do it. |
|
i don't know why you want to do that, but i could be done something like this:
| |
' member variable in usercontrol Private _HostedTextbox As TextBox 'property on the usercontrol Public Property HostedTextBox() As TextBox Get Return Me._HostedTextbox End Get Set(ByVal value As TextBox) Me._HostedTextbox = value End Set End Property |
Then in the form designer-propertygrid you see in the usecontrol a property usercontrol
Set this property to the textbox you like, this could be any textbox on the form
in your usercontrol you could say now something like this
| |
me.Hostedcontrol.text = "Tada!!"
|