本文介绍了如何以编程方式在"CommandBarButton"上执行点击在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



已使用下面的代码来获取MS Excel菜单项的引用.现在,我要以编程方式执行单击操作.我有"cb"字样实例并且不确定如何执行单击操作

请对此提供任何帮助.

谢谢,Naveen Kanth Bayi

CommandBarControls ccs = menuBar.Controls;
CommandBarControl cc = ccs [& LiveOffice"];

CommandBarPopup cbp =(CommandBarPopup)s cc;
Control1 cc = 1 ;转到对象''];

CommandBarPopup cbp1 =(CommandBarPopup)cc1;

Hi,

Have used below code to get the reference of the MS Excel menu item. Now I would like to perform the click operation programatically. I am having the "cb" instance and not sure how to perform click operation

Appreciate any help regarding the same.

Thanks,
Naveen Kanth Bayi

                CommandBarControls ccs = menuBar.Controls;
                CommandBarControl cc = ccs["&LiveOffice"];

                CommandBarPopup cbp = (CommandBarPopup)cc;
                CommandBarControls ccs1 = cbp.Controls;
                CommandBarControl cc1 = ccs1["&Go To Object"];

                CommandBarPopup cbp1 = (CommandBarPopup)cc1;
                CommandBarControls ccs2 = cbp1.Controls;
                CommandBarButton cb = (CommandBarButton)ccs2["&Report"];

推荐答案

感谢您的帖子!我建议将您的问题发布到 MSDN 论坛首页> Visual C#> Visual C#语言位于此处: http: //social.msdn.microsoft.com/Forums/zh-CN/csharplanguage/threads/.

Thank you for your post!  I would suggest posting your question in one of the MSDN > Forums Home > Visual C# > Visual C# Language located here:  http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/threads/.

祝您有美好的一天!


这篇关于如何以编程方式在"CommandBarButton"上执行点击在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 23:07