当前位置: 首页>>代码示例>>C#>>正文


C# Microsoft.Office.Core.FindControl方法代码示例

本文整理汇总了C#中Microsoft.Office.Core.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Core.FindControl方法的具体用法?C# Microsoft.Office.Core.FindControl怎么用?C# Microsoft.Office.Core.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Office.Core的用法示例。


在下文中一共展示了Microsoft.Office.Core.FindControl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCommandBarButton

        private Office.CommandBarButton CreateCommandBarButton(
            Office.CommandBar commandBar, string captionText, string tagText,
            string tipText, Office.MsoButtonStyle buttonStyle, System.Drawing.Bitmap picture,
            bool beginGroup, bool isVisible, object objBefore, Office._CommandBarButtonEvents_ClickEventHandler handler)
        {
            // Determine if button exists
            Office.CommandBarButton aButton = (Office.CommandBarButton)
                commandBar.FindControl(buttonStyle, null, tagText, null, null);

            if (aButton == null)
            {
                // Add new button
                aButton = (Office.CommandBarButton)
                    commandBar.Controls.Add(Office.MsoControlType.msoControlButton, 1, tagText, objBefore, true);

                aButton.Caption = captionText;
                aButton.Tag = tagText;
                if (buttonStyle != Office.MsoButtonStyle.msoButtonCaption)
                {
                    aButton.Picture = (IPictureDisp)AxHost2.GetIPictureDispFromPicture(picture);
                }
                aButton.Style = buttonStyle;
                aButton.TooltipText = tipText;
                aButton.BeginGroup = beginGroup;
                aButton.Click += handler;
            }

            aButton.Visible = isVisible;

            return aButton;
        }
开发者ID:s0lt4r,项目名称:spamgrabber,代码行数:31,代码来源:ThisAddIn.cs

示例2: MkSMenu

        /// <summary>
        /// MakeSubMenu
        /// </summary>
        /// <param name="o">The parent menu object</param>
        /// <param name="sm">The submenu caption</param>
        /// <param name="tag">The tag of the submenu created</param>
        /// <param name="e"></param>
        /// <returns>The newly created submenu</returns>
        private Office.CommandBarButton MkSMenu(Office.CommandBar o, string sm, string tag, Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler e)
        {
            Office.CommandBarButton f = (Office.CommandBarButton)(o.FindControl(Office.MsoControlType.msoControlButton, missing, tag, System.Type.Missing));
            if (f != null)
            {
                f.Click -= e;
                f.Delete();
                f = null;
            }
            f = (Office.CommandBarButton)(o.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true));
            f.Tag = tag;
            f.accName = f.Caption = sm;
#if test
            RemoveClickEvent(f);
#endif
            f.Click += e;
            return f;
        }
开发者ID:apis-bulgaria,项目名称:EUCases.EULinksChecker,代码行数:26,代码来源:EULinksCheckerAddIn.cs

示例3: SubMenuExists

 private bool SubMenuExists(Office.CommandBar o, string tag)
 {
     Office.CommandBarButton f = (Office.CommandBarButton)o.FindControl(Office.MsoControlType.msoControlButton, missing, tag, System.Type.Missing);
     return (f != null);
 }
开发者ID:apis-bulgaria,项目名称:EUCases.EULinksChecker,代码行数:5,代码来源:EULinksCheckerAddIn.cs

示例4: MkMenu

 /// <summary>
 /// another Make menu overload made for convinience
 /// </summary>
 /// <param name="o"></param>
 /// <param name="s"></param>
 /// <param name="tag"></param>
 /// <returns></returns>
 private Office.CommandBarPopup MkMenu(Office.CommandBar o, string s, string tag)
 {
     Office.CommandBarPopup f = (Office.CommandBarPopup)o.FindControl(Office.MsoControlType.msoControlPopup, missing, tag, System.Type.Missing);
     if (f != null) DelPopup(f);
     f = (Office.CommandBarPopup)o.Controls.Add(Office.MsoControlType.msoControlPopup, missing, missing, 1, true);
     f.Tag = tag;
     f.accName = f.Caption = s;
     return f;
 }
开发者ID:apis-bulgaria,项目名称:EUCases.EULinksChecker,代码行数:16,代码来源:EULinksCheckerAddIn.cs

示例5: MenuExists

 private Office.CommandBarPopup MenuExists(Office.CommandBar o, string tag)
 {
     Office.CommandBarPopup f = (Office.CommandBarPopup)o.FindControl(Office.MsoControlType.msoControlPopup, System.Type.Missing, tag, System.Type.Missing);
     return f;
 }
开发者ID:apis-bulgaria,项目名称:EUCases.EULinksChecker,代码行数:5,代码来源:EULinksCheckerAddIn.cs

示例6: DisplayMenuOption

        private void DisplayMenuOption(Office.CommandBar commandBar, Outlook.MAPIFolder folder)
        {
            try
            {
                var READOUT_BUTTON_ID = "READOUT_BUTTON_ID";
                if (commandBar.FindControl(Tag: READOUT_BUTTON_ID) != null)
                {
            #if DEBUG
                    Util.AppLogger.WriteLine("Already exists");
            #endif
                    return;
                }

                //var btnInitReadOut = (Office.CommandBarButton)commandBar.Controls.Add(Type: Office.MsoControlType.msoControlButton);
                //btnInitReadOut.Tag = READOUT_BUTTON_ID;
                //                btnInitReadOut.Caption = "Reinitiali&ze ReadOut Key Hook";
                //btnInitReadOut.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(btnInitReadOut_Click);
                var btnReadOut = (Office.CommandBarButton)commandBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, missing, missing);
                btnReadOut.Tag = READOUT_BUTTON_ID;
                btnReadOut.Caption = "Read&Out";
                btnReadOut.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(btnReadOut_Click);
                CurrentFolder = folder;
                                                if (folder.Items.Count <= 0)
                    btnReadOut.Enabled = false;

            #if DEBUG
                                                var btnDump = (Office.CommandBarButton)commandBar.Controls.Add(Type: Office.MsoControlType.msoControlButton);
                                                btnDump.Caption = "Dump Key Hook";
                                                btnDump.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(
                                                    (Office.CommandBarButton Ctrl, ref bool CancelDefault) => _panelManager.WriteState()
                );
                #endif
            }
            catch (Exception ex)
            {
                ExceptionHandler.Catch(ex);
            }
        }
开发者ID:varunkho,项目名称:ReadOut,代码行数:38,代码来源:ThisAddIn.cs


注:本文中的Microsoft.Office.Core.FindControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。