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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem invalidating toggle button on ribbon

Status
Not open for further replies.

PRMiller2

Technical User
Jul 30, 2010
123
Hi all,

I have the following code:

Code:
Public gobjRibbon As IRibbonUI

Sub OnRibbonLoad(ribbon As IRibbonUI)
    ' Callbackname in XML File "onLoad"

    Set gobjRibbon = ribbon
End Sub

Sub OnActionTglButton(control As IRibbonControl, pressed As Boolean)
'ToggleButton
                              
    ' Callbackname in XML File "onAction"
    
    Select Case control.id
        Case "tgbSnapReportPrint"
            ' tabSnap.grpSnapReports
            gobjRibbon.InvalidateControl ("tgbSnapReportsPreview")
        Case "tgbSnapReportPreview"
            ' tabSnap.grpSnapReports
            gobjRibbon.InvalidateControl ("tgbSnapReportsPrint")
    End Select

End Sub

The purpose of this code is to not allow both the tgbSnapReportsPrint and tgbSnapReportsPreview buttons to be in a state of "pressed" at the same time. If Print is pressed, then Preview should not be, and vice versa. The code does not fail on a debug/compile, and it does not error out during execution. However, the button that I wish to turn off remains in a pressed state unless I physically click on the button itself.

Any suggestions as to what I can do to fix this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top