help!
Printable View
help!
in VB6 only:
private withevents btnObj as OptionButton
private Sub Form_Load()
set btnObj = Controls.Add("VB.OptionButton", "btnObj")
With btnObj
.Visible = true
.Width = 2000
.Caption = "Dynamic Button"
.Top = 1000
.Left = 1000
End With
End Sub
'for more sample see MSDN Dynamic Control Addition
In VB5 you have to have at least 1 option button with Index = 0 (Array), and using Load statement you can add new elements to that array:
Load Option1(1)
Option1(1).Top=2000
........
You can do it ofcourse in VB6 too.
Vlad
thanks so much Vlad! <bow>
Why not just add the option control to your form, set it's visible property to false at design time and toggle this property as needed at run-time in the corresponding events.