Click to See Complete Forum and Search --> : setting state of a button


dsdsds
August 7th, 2001, 06:34 AM
How can I set the state of a button so that it looks as if it is pushed?

thanx,

ds

Cimperiali
August 7th, 2001, 06:48 AM
'you do this with toolbar buttons (not with commandbutton). Add a toolbar to
'your form (=microsoft windows common controls) and this code:
With Toolbar1
.Buttons.Add , "AA", "AA"
.Buttons("AA").Value = tbrPressed
End With
'you may assign pictures (icons) to these buttons just adding a imagelist
'control, adding images to it and assigning the imagelist to the listimage
'property of toolbar, then assigning a image to each button by index or by
'key




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

deghost
August 7th, 2001, 02:22 PM
You can't, but you can achieve the same results using a CheckBox.
add a new CheckBox, set style to 1-Graphical and walla! you have a command button. set its value to 1 or 0 to make it pushed or unpushed.

----------
The @host is everywhere!
----------