|
-
July 29th, 2009, 11:15 PM
#1
Load Controls
Hello,
I have made a custom Control in vb.net and I want to add it to my form during runtime but have no idea how to do it in vb.net.
I am used to working with vb6.0 and now trying to learn how to do it in vb.net
I need a fast and simple way of adding a control (which I made) to a form during runtime..
Anyone know how to do it?
Thanks.
-
July 30th, 2009, 01:17 AM
#2
Re: Load Controls
Is the usercontrol part of your project, or is it a separate DLL referenced by your project ¿
-
July 30th, 2009, 01:59 AM
#3
Re: Load Controls
Hello,
The User Control is part of my project.
I have found this so far:
Code:
Dim UserControl1 As New The_User_Control
UserControl1.Top = "0"
UserControl1.Left = "5"
UserControl1.Width = Me.Width - 10
Me.Controls.Add(UserControl1)
That code adds it to the form using runtime like how I wanted but the width of the control don't resize to way I want it to.
There is no Code in the user control that sets the width of the control so there shouldn't be any problem.
Any ideas why it not resizing? or am I doing it wrong?
Hope someone can help
Thanks.
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
|