|
-
Jun 21st, 2006, 04:01 AM
#1
[02/03] How can I call a Usercontrole into my Form?
Hi All,,
Like the question said.
I've created a UserControle and how can I showed up into a Form.
Thanks in Advance,
sparrow1
-
Jun 21st, 2006, 04:14 AM
#2
Re: [02/03] How can I call a Usercontrole into my Form?
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.
-
Jun 21st, 2006, 05:59 PM
#3
Re: [02/03] How can I call a Usercontrole into my Form?
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
-
Jun 21st, 2006, 06:56 PM
#4
Re: [02/03] How can I call a Usercontrole into my Form?
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.
VB Code:
Dim UserControl1 As New UserControl
Me.Controls.Add(UserControl1)
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|