User Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

i created a user control, inside the user control there is a text box. I placed the user control on a seperate form. how do i get the value that is inside the text box using the code in the form .. ?

Need Code PLEASE !!
 
Jay said:
i created a user control, inside the user control there is a text
box. I placed the user control on a seperate form. how do i get the
value that is inside the text box using the code in the form .. ?

Declare the Textbox friend or public (modifiers property) and you can access
it like any other member of the usercontrol.
 
Even better, do not expose the TextBox itself (as the control's client will
be able to do anything to the TextBox in this case), but rather create a
ReadOnly String property which will return the textbox'es Text property
value.
 
Back
Top