|
-
December 6th, 1999, 08:44 PM
#1
How do I add an option button to a form at runtime? plz help
-
December 6th, 1999, 09:48 PM
#2
Re: How do I add an option button to a form at runtime? plz 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
-
December 6th, 1999, 10:05 PM
#3
Re: How do I add an option button to a form at runtime? plz help
thanks so much Vlad! <bow>
-
January 11th, 2000, 03:56 PM
#4
Re: How do I add an option button to a form at runtime? plz help
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|