Control that adds a control

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

Guest

Looking for expert guidance here.

I have a user control. When I drop it onto the form at design time, I want
it to create a textbox and add it to the same form. Can this be done?
 
Let be be a teeny bit more clear.

If I add the code:

Private Sub UserControl1_ParentChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.ParentChanged
Me.Parent.Controls.Add(New TextBox)
End Sub

The textbox gets added to the parent form. The PROBLEM I am trying to solve
is that although you can see the textbox, you cannot access it's properties
in the properties window. THAT's what I need to figure out.

Thanks.
 
The TabControl manages to do this when you add a Page tothe TabPages
collection, so I KNOW it's possible!


:-)
 
I see that no one has an answer... the reason why... because you CANT. I
just spent a couple hours on the phone with MS, and they researched the
VB.NET code itself and it's just not possible. Bummer. Just thought I'd
post this in case anyone else burns rubber trying to figure this one out
sometime.

-Zorpie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top