Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a Command Button appear pressed in?

Status
Not open for further replies.

menstroy

MIS
Jun 2, 2003
63
US
Hello,

I have a phone book spreadsheet and I want to have 26 command buttons, one for each letter.

When the users presses a command button it will apply a filter and only show names starting in that letter selected.

However I would like to make the command button appear that it is pressed in even after the user clicks on that button? Is this possible? I have tried options groups but I keep getting errror messages about not being able to apply the fitler cause of when the event is kicked off.
 
Use a toggle button instead of a command button. It will stay pressed in until the user clicks it again, and you can control the "pressed in" look by setting its value to true or false in code.
 
Hi,
I agree with vbajock. Toggles are the way to go.

The only question is whether you only want to be able to use one of the filters at one time (IE display things that start with a & b)

If you only want to be able to use one filter at a time then you can put all the togglebuttons within an OptionGroup and save yourself from writing 26 individual Click Events for each Toggle.

Alec Doughty
Doughty Consulting P/L

"Life's a competition. Play hard, but play fair"
 
Guys, you've made me a happy bunny! I didn't know about toggle buttons within option groups. It's almost (but not quite) like VB6 Control Arrays which I think are great because you can code things once using the Index parameter to decide what you want to do. The optGroup.Value property gives me a bit of this facility - not all unfortunately but a lot better than nothing.

PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top