|
-
August 3rd, 2001, 08:55 AM
#1
Creating a Button at Runtime
How I can create a CommandButton at runtime???
Thanks
Arnaldo
-
August 3rd, 2001, 08:58 AM
#2
Re: Creating a Button at Runtime
There are many examples here in CodeGuru. Use the search option (on top left of page). Or have a look at this:
http://codeguru.com/cgi-bin/bbs/wt/s...age=0&Limit=25
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 3rd, 2001, 10:25 PM
#3
Re: Creating a Button at Runtime
Have the button on your form but make it invisible
When you want it to appear
Command1.Visible = true
73 RSH
-
August 6th, 2001, 02:59 AM
#4
Re: Creating a Button at Runtime
You may also have a button invisible with index = 0 and when you need one more, you can use the load statement incrementing index
ie:
load command1(ubound(command1+1))
with command1(ubound(command1))
left=command1(ubound(command1)-1).left +command1(ubound(command1)-1).width
top=command1(ubound(command1)-1).top
caption="AAA"
visible = true
end with
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 9th, 2001, 12:22 PM
#5
Re: Creating a Button at Runtime
private withevents cmd as commandbuttons
'on any events
set cmd = controls.add("vb.commandbutton","name")
cmd.visible=true
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
|