L
Ludo
Hi,
I use the toggle button code from Ron De Bruin's site (http://www.rondebruin.nl/getimage.htm) to change te state of the toggle button and change also the picture in the toggle button.
The problem i have is that the pictures don't show up in the button.
Both pictures are .png and are embedded in the CustomUI.xml file.
here's the code i use (all in the same module):
Dim myRibbon As IRibbonUI
Dim PressedState As Boolean
'*****************************************
'Ribbon callback functions / routines
'*****************************************
'Callback for customUI.onLoad
Sub RibbonLoaded(ribbon As IRibbonUI)
Set myRibbon = ribbon
PressedState = False
End Sub
'Callback for customToggleButton1 onAction
Sub Macro1(control As IRibbonControl, pressed As Boolean)
Select Case pressed
Case True
PressedState = True
Case False
PressedState = False
End Select
myRibbon.InvalidateControl ("customToggleButton1")
End Sub
Sub GetImage(control As IRibbonControl, ByRef image)
Select Case control.ID
Case "customToggleButton1"
Select Case PressedState
Case True: image = "Close-2-icon" 'picture don't show up
Case False: image = "zip-icon" 'picture don't show up
End Select
End Select
End Sub
Sub GetLabel(ByVal control As IRibbonControl, ByRef label)
Select Case control.ID
Case "customToggleButton1"
Select Case PressedState
Case True: label = "Stop Auto Zip"
Case False: label = "Start Auto Zip"
End Select
End Select
End Sub
Any idea why?
I can use those pictures on a normal custom button, but are not showing up in the toggle button.
I tried also to add the file extension (Case True: image = "Close-2-icon.png") but no luck at all.
any help apreciated.
Regards,
Ludo
I use the toggle button code from Ron De Bruin's site (http://www.rondebruin.nl/getimage.htm) to change te state of the toggle button and change also the picture in the toggle button.
The problem i have is that the pictures don't show up in the button.
Both pictures are .png and are embedded in the CustomUI.xml file.
here's the code i use (all in the same module):
Dim myRibbon As IRibbonUI
Dim PressedState As Boolean
'*****************************************
'Ribbon callback functions / routines
'*****************************************
'Callback for customUI.onLoad
Sub RibbonLoaded(ribbon As IRibbonUI)
Set myRibbon = ribbon
PressedState = False
End Sub
'Callback for customToggleButton1 onAction
Sub Macro1(control As IRibbonControl, pressed As Boolean)
Select Case pressed
Case True
PressedState = True
Case False
PressedState = False
End Select
myRibbon.InvalidateControl ("customToggleButton1")
End Sub
Sub GetImage(control As IRibbonControl, ByRef image)
Select Case control.ID
Case "customToggleButton1"
Select Case PressedState
Case True: image = "Close-2-icon" 'picture don't show up
Case False: image = "zip-icon" 'picture don't show up
End Select
End Select
End Sub
Sub GetLabel(ByVal control As IRibbonControl, ByRef label)
Select Case control.ID
Case "customToggleButton1"
Select Case PressedState
Case True: label = "Stop Auto Zip"
Case False: label = "Start Auto Zip"
End Select
End Select
End Sub
Any idea why?
I can use those pictures on a normal custom button, but are not showing up in the toggle button.
I tried also to add the file extension (Case True: image = "Close-2-icon.png") but no luck at all.
any help apreciated.
Regards,
Ludo