Load Controls
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
    Posts
    228

    Question 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.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,090

    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
    Posts
    228

    Question 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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center