Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Help with faceid and button images

I have already read a lot about toolbars and I couldn't find about changing
the faceid icons of my toolbar when a button is selected or deselected (I
mean the same button), please HELP, I realy need to accomplish this.
specifically I can ask you:

1)¿How to define the button name (the one that use VB) in my toolbar?
2) "Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add" is to
add a button, but if I want to name a button that has already exist ¿How?

Could comeone paste a simple code of I want to accoplish (when the user
press a button something happend (macro) and the button images changes, and
when the user press the same button (with the new image on it) something
happend (revert the last action) and the button image returs to his original
state.

PLEASE I WILL BE GRATEFULLY

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Help with faceid and button images

Here is some code for a menu bar. A tool bar is almost identical. Whe the
button was originally created this is the macro that is specified in the on
action.

Private Const m_cMenuBar As String = "Worksheet Menu Bar"
Private Const m_cMenuName As String = "FPA"

Private Sub FooterPath()
On Error GoTo ErrorHandler
Dim cbrMenu As CommandBar
Dim ctlCBarControl As CommandBarButton

Set cbrMenu = CommandBars(m_cMenuBar)
Set ctlCBarControl = cbrMenu.Controls(m_cMenuName).Controls("Add Path to
Footer")

If ctlCBarControl.State = msoButtonDown Then
'Call your macro to do something here
ctlCBarControl.State = msoButtonUp
Else
'Call your macro to reverse something here
ctlCBarControl.State = msoButtonDown
End If
Set cbrMenu = Nothing
Set ctlCBarControl = Nothing

End Sub

This code checks the state of the button (button up or button down) and
decides what it needs to do based on that state. For your code you would want
to check the FaceId or caption and do whatever you need to do based on that...

HTH

"filo666" wrote:

I have already read a lot about toolbars and I couldn't find about changing
the faceid icons of my toolbar when a button is selected or deselected (I
mean the same button), please HELP, I realy need to accomplish this.
specifically I can ask you:

1)¿How to define the button name (the one that use VB) in my toolbar?
2) "Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add" is to
add a button, but if I want to name a button that has already exist ¿How?

Could comeone paste a simple code of I want to accoplish (when the user
press a button something happend (macro) and the button images changes, and
when the user press the same button (with the new image on it) something
happend (revert the last action) and the button image returs to his original
state.

PLEASE I WILL BE GRATEFULLY

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Help with faceid and button images

hoooo jim; Where have you been????
I have been looking for the answer of this question all day, Thanks for your
answer, today I'm finishing my job day, and tomorow is mothers day (in
Mexico) and nobody works, so I will try your code on wednesday, I hope you'll
be here (or there how ever you want to see it) to tell you how it works and
if I have more questions, Thanks for your Help¡¡¡¡

"Jim Thomlinson" wrote:

Here is some code for a menu bar. A tool bar is almost identical. Whe the
button was originally created this is the macro that is specified in the on
action.

Private Const m_cMenuBar As String = "Worksheet Menu Bar"
Private Const m_cMenuName As String = "FPA"

Private Sub FooterPath()
On Error GoTo ErrorHandler
Dim cbrMenu As CommandBar
Dim ctlCBarControl As CommandBarButton

Set cbrMenu = CommandBars(m_cMenuBar)
Set ctlCBarControl = cbrMenu.Controls(m_cMenuName).Controls("Add Path to
Footer")

If ctlCBarControl.State = msoButtonDown Then
'Call your macro to do something here
ctlCBarControl.State = msoButtonUp
Else
'Call your macro to reverse something here
ctlCBarControl.State = msoButtonDown
End If
Set cbrMenu = Nothing
Set ctlCBarControl = Nothing

End Sub

This code checks the state of the button (button up or button down) and
decides what it needs to do based on that state. For your code you would want
to check the FaceId or caption and do whatever you need to do based on that...

HTH

"filo666" wrote:

I have already read a lot about toolbars and I couldn't find about changing
the faceid icons of my toolbar when a button is selected or deselected (I
mean the same button), please HELP, I realy need to accomplish this.
specifically I can ask you:

1)¿How to define the button name (the one that use VB) in my toolbar?
2) "Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add" is to
add a button, but if I want to name a button that has already exist ¿How?

Could comeone paste a simple code of I want to accoplish (when the user
press a button something happend (macro) and the button images changes, and
when the user press the same button (with the new image on it) something
happend (revert the last action) and the button image returs to his original
state.

PLEASE I WILL BE GRATEFULLY

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
Export custom Macro Button Images RWN Excel Discussion (Misc queries) 1 November 26th 06 10:53 AM
Button Images Simon Shaw[_5_] Excel Programming 2 January 10th 05 03:14 PM
where are those toolbar button images? fengk Excel Programming 2 October 26th 04 08:32 PM
Button Faceid David Fixemer Excel Programming 2 February 21st 04 12:18 AM
Copy button images raj Excel Programming 1 November 6th 03 04:27 PM


All times are GMT +1. The time now is 11:52 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"