Changin container of a control

Y

Young

I loaded a button at run time and this button correspond to a text box.

The textbox can be on a form or a panel control.

In VB6, I can do this to make the button's container the same as the textbox
without worrying about whether the textbox is on a panel or a form:

mybutton.container = mytxt.container.

Can someone please tell me how I can do the same in VB.Net
 
D

Dale Atkin

In VB6, I can do this to make the button's container the same as the
textbox without worrying about whether the textbox is on a panel or a
form:

mybutton.container = mytxt.container.

Can someone please tell me how I can do the same in VB.Net

Have you looked at 'getcontainercontrol'?

Dale
 
J

Jack Jackson

I loaded a button at run time and this button correspond to a text box.

The textbox can be on a form or a panel control.

In VB6, I can do this to make the button's container the same as the textbox
without worrying about whether the textbox is on a panel or a form:

mybutton.container = mytxt.container.

Can someone please tell me how I can do the same in VB.Net

mybutton.Parent = mytxt.Parent
 

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

Top