hi
i know how to create another object on the same form.
try this
note that you can only use it once, or you need to change the commandbutton's name !
-
-
Dim ctlName As Control
-
Set ctlName = frmMain.Controls.Add("VB.CommandButton", "Command2", Form1)
-
With ctlName
-
.Visible = True
-
.Caption = "New button"
-
.Move 400, 400, 1400, 480
-
End With
-
-
hi another thing
if you create a new button, there is no code behind it, so you can't expect any action when pressed.
might be better if you pre-created a non visible button (with code) and make it visible