Outlook功能区复选框:如何获取项目复选框或如何验证其状态? [英] Outlook ribbon checkbox: How to get item checkbox or how to verify its state ?
问题描述
您好!
我需要知道如何获取功能区项目,但不能找到有关如何获取功能区项目的信息。实际上我在功能区中有一个复选框,可以捕获事件检查和取消选中。这很好。要创建功能区,我使用XML和一个Ribbon类,我在其中编写了回调函数。
我的问题:有没有办法访问该项目并获得或设置其状态?
非常感谢
hi,
感谢您的查询。
AFAIK,要知道复选框的检查状态,你可以使用bool变量,它将在适当的复选控制回调事件中设置/重置,如下所示:public void OnActionCallback(Office.IRibbonControl control,bool isPressed)
{
if(control.Id ==" checkBox_1")
{
variable = _pressed
}
}
感谢
~Anita
Hello!
I need to know how to get ribbon items but don`t find information on how to get ribbon items. Actually i have a checkbox in a ribbon, can capture the events check and uncheck. That works fine. To create the ribbon I use XML and a Ribbon class in which i wrote my callback functions.
My question: is there a way to access that item and and get or set its state?
Thanks a lot
hi,
thanks for your query.
AFAIK, to know the check status of checkbox, you can use a bool variable, which will be set/reset in the appropiate call back events of checkbox control as shown below:public void OnActionCallback(Office.IRibbonControl control, bool isPressed) { if (control.Id == "checkBox_1") { variable = _pressed } }thanks
~Anita
这篇关于Outlook功能区复选框:如何获取项目复选框或如何验证其状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!