Could it be possible to create buttons at runtime and not in design time? and also please explain the uses of commands being used ...
i will appreciate it very much ....thanks
Printable View
Could it be possible to create buttons at runtime and not in design time? and also please explain the uses of commands being used ...
i will appreciate it very much ....thanks
Dim cmd As CommandButton
Set cmd = Controls.Add("vb.commandbutton", "Name")
cmd.Visible = True
Then u can set its left and right as u want
Best of luck
take a command button command1 at design time and set it's index property to 0.this will create a control array with the first item as command1(0).set it's visible property to false.now type this code in the event procedure.
load command1(1)
command1(1).visible=true
command1(1).left=1000
command1(1).top=1000
if you want to create more than one command buttons then use this code
static i as integer
i=i+1
load command1(i)
command1(i).visible=true
command1(i).left=1000
command1(i).top=1000
hope it helps you.
Have also a look here:
http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater