CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Load Controls

  1. #1
    Join Date
    Mar 2006

    Question Load Controls


    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?


  2. #2
    Join Date
    Jul 2001
    Sunny South Africa

    Re: Load Controls

    Is the usercontrol part of your project, or is it a separate DLL referenced by your project ¿

  3. #3
    Join Date
    Mar 2006

    Question Re: Load Controls


    The User Control is part of my project.

    I have found this so far:

                Dim UserControl1 As New The_User_Control
                UserControl1.Top = "0"
                UserControl1.Left = "5"
                UserControl1.Width = Me.Width - 10
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.