Hi All,,
Like the question said.
I've created a UserControle and how can I showed up into a Form.
Thanks in Advance,
sparrow1
Printable View
Hi All,,
Like the question said.
I've created a UserControle and how can I showed up into a Form.
Thanks in Advance,
sparrow1
A UserControl is a control like any other, so you show it on a form like any other. If you're talking about doing so at run time then, just like any other control, you have to pass it to the Controls.Add method of the intended parent control.
Hi jm,
Thanks for your reply.
I created the Usercontrol with several radiobuttons during designtime ( UserControl1.vb) so it's nearly the same like a Form I thought, but it didn't worked that way to show it into the form1.
I've tryed something like:
VB Code:
Dim UserControl1 As New UserControl UserControl1.Show()
Is there a way to show it into my form1?
Thanks,
sparrow1
Quote:
A UserControl is a control like any other, so you show it on a form like any other. If you're talking about doing so at run time then, just like any other control, you have to pass it to the Controls.Add method of the intended parent control.
The Show method simply sets the Visible property to True, which it is by default. If the control has not been added to a container then it doesn't matter what its Visible property is.VB Code:
Dim UserControl1 As New UserControl Me.Controls.Add(UserControl1)