Skip to content

How do I change the text of a textbox inside a user control.

david vassallo

Asked Sep 1, 2005, 7:28 AM EDT2 answers
Share
LinkedInX

I have created a Control which has 4 textboxes. I have dragged the control into a windows Form and from this window form i need to set the text of the textboxes. Is there a way i could change the text of a textbox which is inside another control.

Thanks
David

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0

    Type the name of the container (the user control) followed by a dot and the textbox name.

    Example:  mycontrol.textbox1.Text = "Hello"

    0
  • 0
    Thanks for the reply, I was trying the method you told me then i realized that the textboxes where declared private inside the control. I changed the declaration to public and solved the problem.

    Thanks again,
    David
    0