-
What would be the easiest way to create command buttons based apon stored settings. Say you want to make a cusomiseable shortcut bar, but you want the user to be able to specify as many buttons linked to any exe. i know how to do everything except make the command buttons at runtime. Any suggestions?
-
Straight from MSDN
Code:
Option Explicit
Private WithEvents btnObj As CommandButton
Private Sub btnObj_Click()
MsgBox "This is a dynamically added button."
End Sub
Private Sub Form_Load()
Set btnObj = Controls.Add("VB.CommandButton", "btnObj")
With btnObj
.Visible = True
.Width = 2000
.Caption = "Hello"
.Top = 1000
.Left = 1000
End With
End Sub
Regards,
TheBao
-
Thanx man that is exactly what i was looking for.