Auto-Depress Buttons???

  • Thread starter Thread starter Bill Sturdevant
  • Start date Start date
B

Bill Sturdevant

I have a screen full of buttons that perform individual
functions.

I have a final button that will perform ALL of the
functions of the other buttons. It calls each button's
Click handler in turn.

Is there any way I can cause each button to "look" like it
was clicked as its code is executed (so that the button
looks depressed)?
 
Bill said:
I have a screen full of buttons that perform individual
functions.

I have a final button that will perform ALL of the
functions of the other buttons. It calls each button's
Click handler in turn.

Is there any way I can cause each button to "look" like it
was clicked as its code is executed (so that the button
looks depressed)?


Not unless you want to get into all the complexities of
Windows API coding (which I can't help you with), but you
can use Label controls instead. Set their SpecialEffect
property to Raised in design view and use code to change it
in your button's Click event"

Sub label_Click()
Me.label.SpecialEffect = 2 'Sunken
' existing code
Me.label.SpecialEffect = 1 'Raised
End Sub

If you need to allow users to use the keyboard to tab to the
controls, then use Text boxes instead of labels (set their
Locked property to Yes to prevent inadvertent data entry).
 
Bill,

Instead of using command buttons, use toggle buttons. They have a Click event
too. To make it depressed use Me!NameOfToggleButton = True and to return it to
not depressed use Me!NameOfToggleButton = False.
 
Back
Top