Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hello, I am looking to populate a form with buttons based on the results from a db query..

 

So lets say, the db query returns: Red, Green, Blue, Purple

I would want vb to create 4 buttons, space them 20 pixels appart, and make the name of the button to correspond to the db query.

 

So the result would be :

 

(Red) (Green)(Blue)

(Purple)

 

(the form only has room for 3 button wide).

 

 

thanks for any pointers!

Lee

Edited by trend
Posted

i wish I could delete posts.. because there was a post with the identical name to this one that had the answer :/

 


       Dim btn As New Button

       With btn
           .Size = New Size(90, 40)
           .Location = New Point(15, 15)
           .Text = "Testing 1 2 3"

           'causes the newbtnClick procedure to fire on the click event.
           AddHandler btn.Click, AddressOf newbtnClick
       End With

       Me.Controls.Add(btn)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...