I want to create a textbox programmaticall y and add the SAME textbox to
to different panels. This code does not work:
Dim tb As New TextBox
tb.text = "xyz"
Panel1.Controls .Add(tb)
Panel2.Controls .Add(tb)
The textbox gets added to Panel2, but not Panel1. How can i get the
textbox to go to both panels? I can get it to work by duplicating the
code block... one code block puts the textbox in Panel1 and the other
one to Panel2. But i don't want to duplicate lots of code... i'd rather
have it in one code block.
Thanks!
John
to different panels. This code does not work:
Dim tb As New TextBox
tb.text = "xyz"
Panel1.Controls .Add(tb)
Panel2.Controls .Add(tb)
The textbox gets added to Panel2, but not Panel1. How can i get the
textbox to go to both panels? I can get it to work by duplicating the
code block... one code block puts the textbox in Panel1 and the other
one to Panel2. But i don't want to duplicate lots of code... i'd rather
have it in one code block.
Thanks!
John
Comment