Clicking a button is just that??”a simple click, and the
action is done. In the case of a check box, a click either selects (pressed = True) or deselects
(pressed = False) the control. Therefore, an additional parameter is required for check boxes.
The complete callback procedure for a simple button might be:
Public Sub OnAction(control As IRibbonControl)
DoCmd.OpenForm ???frmMyForm???, , , , acNormal
End Sub
The callback procedure for the check box uses the pressed parameter to determine which path to
take through the procedure:
Public Sub OnAction(control As IRibbonControl, _
pressed As Boolean)
If pressed = True Then
DoCmd.OpenForm ???frmHelp???
Else
DoCmd.Close acForm, ???frmHelp???
End If
End Sub
We??™ve been focusing on the onAction callback, but many other callbacks exist. Here is the XML
definition of a simple Label control:
Notice the getLabel attribute. The callback signature of the getLabel attribute is:
Public Sub onGetLabel(control as IRibbonControl, ByRef label)
The Label control is passed as the IRibbonControl parameter, and the label??™s contents are
passed as the (variant) label parameter.
Pages:
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073