Results 1 to 3 of 3

Thread: [2005] Create a control in code...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    [2005] Create a control in code...

    I remember from a long time ago that this is possible but i forget the code to do it.

    How do i create a control in code?

    How would i make it so when a button is clicked it will create a new picture box at location 50, 50 with the resource file smile.bmp? I dont want to just make a already made picture box visible i want to create one.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    Re: [2005] Create a control in code...

    something like this...
    Code:
            Dim pBox As New PictureBox
            MyBase.Controls.Add(pBox)
    
            pBox.Location = New Point(50, 50)
            pBox.Image = Image.FromFile("C:\wave.gif")
            '/// putting your image's location where it says C:\wave.gif
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: [2005] Create a control in code...

    Thankyou i just forgot about the
    Code:
    Dim ???? As New ??????
    . That actually solved a few of my problems.

Posting Permissions

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



Click Here to Expand Forum to Full Width