Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default custom toolbar button that visually toggles in and out

Excel has a few toolbar buttons that are toggle buttons. For example
- the Toggle Grid button on the Forms toolbar or the Design Mode
button on the Control toolbar. The visual appearance of these buttons
changes as you toggle them "in and out".

I know how to create a custom toolbar button that toggles code that's
assigned to it (for example: ActiveCell.Font.Bold = Not
ActiveCell.Font.Bold) but the visual appearance of such a custom
toolbar button doesn't change, so the user cannot tell which state
it's in. I've even tried assigning my macro to the Toggle Grid button
but that somehow disengaged its ability to change appearance as you
toggled it.

Is there any code that can cause a custom toolbar button to visually
appear to toggle "in and out" with successive clicks?

If that's not possible, is there any code that can change the
foreground color of the button as you "toggle" it? For example, if I
edited the button's image by drawing a solid square on it, is it
possible to have the color of the square change back and forth between
red and black as you "toggle" the button?

Many thanks,
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default custom toolbar button that visually toggles in and out

Rob,

TERRIFIC!! It works perfectly and is exactly what I was looking for!

Thank you so very much for you time and help - I really appreciate it.

Best regards,
Paul



"Rob Bovey" wrote in message ...
Hi Paul,

ctlButton.State = msoButtonDown
ctlButton.State = msoButtonUp

where ctlButton is a reference to your CommandBarButton will toggle the
button state between in and out.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Paul Simon" wrote in message
om...
Excel has a few toolbar buttons that are toggle buttons. For example
- the Toggle Grid button on the Forms toolbar or the Design Mode
button on the Control toolbar. The visual appearance of these buttons
changes as you toggle them "in and out".

I know how to create a custom toolbar button that toggles code that's
assigned to it (for example: ActiveCell.Font.Bold = Not
ActiveCell.Font.Bold) but the visual appearance of such a custom
toolbar button doesn't change, so the user cannot tell which state
it's in. I've even tried assigning my macro to the Toggle Grid button
but that somehow disengaged its ability to change appearance as you
toggled it.

Is there any code that can cause a custom toolbar button to visually
appear to toggle "in and out" with successive clicks?

If that's not possible, is there any code that can change the
foreground color of the button as you "toggle" it? For example, if I
edited the button's image by drawing a solid square on it, is it
possible to have the color of the square change back and forth between
red and black as you "toggle" the button?

Many thanks,
Paul

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost new custom toolbar button with its macro hmm Excel Discussion (Misc queries) 6 July 4th 07 12:26 AM
Invoking a Visual Basic macro from a Custom Toolbar Button [email protected] Excel Worksheet Functions 2 March 1st 07 10:48 AM
How would I move/insert a custom picture (button) onto the toolbar Sandee Excel Discussion (Misc queries) 2 April 20th 06 03:37 PM
custom button to convert into euro on toolbar jigio Excel Discussion (Misc queries) 3 September 5th 05 09:03 PM
Custom toolbar button icons leaftye - ExcelForums.com Excel Discussion (Misc queries) 2 July 7th 05 06:09 PM


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"