C#VSTO Outlook 2007:为CommandBarPopup添加图标
嗨,我想在标准命令栏上添加我的CommandBarPopup按钮的图像图标,如Send&接收按钮。
Popup正在工作,我有按钮图标但我需要弹出窗口中的顶部图标(旁边的小下拉图标)
创建弹出窗口的代码:
moznosti = (Office.CommandBarPopup)standardToolbar.Controls.Add(
Office.MsoControlType.msoControlPopup,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
true);
//向弹出窗口添加按钮是可以的:
nastaveni = (Office.CommandBarButton)moznosti.Controls.Add(1,missing, missing, missing, true);
nastaveni.Caption = "Na&stavení...";
global.SetImage(nastaveni, Properties.Resources.settings);
nastaveni.Style = Office.MsoButtonStyle.msoButtonIconAndCaption;
nastaveni.Click += new Office._CommandBarButtonEvents_ClickEventHandler(ButtonSettingsClick);
......等......
但我需要这样的东西:
moznosti.Picture = ...
但是没有Picture变量(比如在CommandBarButton对象中)
没有找到相关结果
已邀请:
2 个回复
诧不达
中添加图标。至少不是VBA。 (如果vsto暴露出比VBA更多的命令栏模型,我会感到惊讶。)我目前没有在我的机器上安装Outlook,所以我无法检查VBA的实现,但我几乎可以肯定所有办公应用程序中的命令栏模型都是相同的。使用Excel似乎无法在弹出窗口中添加图标。 (刚试过。) 如果您使用的是Outlook 2007,那么为什么不调整功能区呢?组合框或下拉列表可能会完成你所追求的目标。 http://msdn.microsoft.com/en-us/library/bb226712(v=office.12).aspx
畦桨存灯