Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to create a nested group box UI as well as 10 buttons, all at runtime. Could someone guide me into how I can go about doing this? Thanks.
Posted
Updated 28-Oct-10 4:15am
v2
Comments
Simon_Whale 28-Oct-10 10:27am    
are you saying you want to make these appear at runtime without placing any controls on the form?

Easiest way to learn how to do this is to do it via the designer, and then look at the designer generated code. That code is pretty much what you need to write to do this at run-time.
 
Share this answer
 
The example below is for putting a single button into a panel.

VB
btn = new button
btn.name = unqiueButtonName
btn.left = 10
btn.top = 20
btn.Text = "Button Name"

'This is the important part as this is how you add
'the events for button
addHandler btn.click, addressof BtnEvent
panelName.controls.add(btn)


VB
Public sub BtnEvent()
  'Do event handling stuff here
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900