trend Posted March 21, 2005 Posted March 21, 2005 (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 March 21, 2005 by trend Quote
trend Posted March 21, 2005 Author Posted March 21, 2005 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) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.