IRibbonControl Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the object passed into every Ribbon user interface (UI) control's callback procedure.
public interface class IRibbonControl
[System.Runtime.InteropServices.Guid("000C0395-0000-0000-C000-000000000046")]
public interface IRibbonControl
[<System.Runtime.InteropServices.Guid("000C0395-0000-0000-C000-000000000046")>]
type IRibbonControl = interface
Public Interface IRibbonControl
- Attributes
Examples
The following example, written in C#, shows two procedures called from the onAction event procedure of a Button control and a ToggleButton control. In the first procedure, the IRibbonControl object representing the control is passed into the procedure and a message box is displayed indicating that the button was pressed along with the ID of the button. The second procedure is similar to the first with the addition of a Boolean parameter indicating that the button was pressed.
<span class="label">public void ButtonOnAction(IRibbonControl control)
MessageBox.Show("Button clicked: " + control.Id);
}
public void ToggleButtonOnAction(IRibbonControl control, bool pressed)
{
...if (pressed)
MessageBox.Show("ToggleButton was switched on.");
else
MessageBox.Show("ToggleButton was switched off.");
}</span>
Remarks
The IRibbonControl object contains the name (ID) of the control and the current Window object for the Ribbon UI control.
Properties
Context |
Represents the active window containing the Ribbon user interface that triggers a callback procedure. Read-only. |
Id |
Gets the ID of the control specified in the Ribbon XML markup customization file. Read-only. |
Tag |
Used to store arbitrary strings and fetch them at runtime. Read-only |
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기