• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.CommandBarButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.CommandBarButton的典型用法代码示例。如果您正苦于以下问题:C# CommandBarButton类的具体用法?C# CommandBarButton怎么用?C# CommandBarButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommandBarButton类属于System.Windows.Forms命名空间,在下文中一共展示了CommandBarButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateToolbar

        private void CreateToolbar()
        {
            try
            {
                toolBar = FindBar()
                    ?? Application.ActiveExplorer().CommandBars.Add(MenuToolbarTag, MsoBarPosition.msoBarTop, false, true);

                toolBarButton = (CommandBarButton)toolBar.Controls.Add(MsoControlType.msoControlButton, missing, missing, 1, true);
                toolBarButton.Style = MsoButtonStyle.msoButtonIconAndCaption;
                toolBarButton.Caption = "Generate Distribution List";
                toolBarButton.FaceId = 65;
                toolBarButton.Tag = MenuToolbarTag;
                toolBarButton.Click += (CommandBarButton ctrl, ref bool @default) =>
                {
                    MainWindow window = new MainWindow(
                        "NNVDC01",
                        "OU=Sites,OU=Company,DC=domain,DC=corp",
                        "OU=Sites,OU=Company,DC=domain,DC=corp");
                    window.Show();
                };
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error Message");
            }
        }
开发者ID:SergeyRyzhov,项目名称:DLExt,代码行数:26,代码来源:ThisAddIn.cs


示例2: FDMenus

		public FDMenus(IMainForm mainForm)
		{
			// modify the view menu
			CommandBarMenu viewMenu = mainForm.GetCBMenu("ViewMenu");
			View = new CommandBarButton("&Project Explorer");
			View.Image = Icons.Project.Img;
			viewMenu.Items.Add(View);

			// modify the tools menu - add a nice GUI classpath editor
			GlobalClasspaths = new CommandBarButton("&Global Classpaths...");
			GlobalClasspaths.Shortcut = Keys.F9 | Keys.Control;

			mainForm.IgnoredKeys.Add(GlobalClasspaths.Shortcut);

			CommandBarMenu toolsMenu = mainForm.GetCBMenu("ToolsMenu");
			toolsMenu.Items.AddSeparator();
			toolsMenu.Items.Add(GlobalClasspaths);

			ProjectMenu = new ProjectMenu();

			CommandBar mainMenu = mainForm.GetCBMainMenu();
			mainMenu.Items.Insert(5, ProjectMenu);

			RecentComboBox = RecentComboBox.Create();

			CommandBar toolBar = mainForm.GetCBToolbar();

			if (toolBar != null) // you might have turned off the toolbar
			{
				toolBar.Items.AddSeparator();
				toolBar.Items.Add(ProjectMenu.TestMovie);
				toolBar.Items.Add(RecentComboBox);
			}
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:34,代码来源:FDMenus.cs


示例3: ProjectMenu

		public ProjectMenu()
		{
			NewProject = new CommandBarButton("&New Project..");
			NewProject.Image = Icons.NewProject.Img;

			OpenProject = new CommandBarButton("&Open Project..");

			CloseProject = new CommandBarButton("&Close Project");

			TestMovie = new CommandBarButton("&Test Movie");
			TestMovie.Image = Icons.GreenCheck.Img;

			BuildProject = new CommandBarButton("&Build Project");
			BuildProject.Image = Icons.Gear.Img;

			Properties = new CommandBarButton("&Properties");
			Properties.Image = Icons.Options.Img;

			base.Text = "&Project";
			base.Items.Add(NewProject);
			base.Items.Add(OpenProject);
			base.Items.Add(CloseProject);
			base.Items.AddSeparator();
			base.Items.Add(TestMovie);
			base.Items.Add(BuildProject);
			base.Items.AddSeparator();
			base.Items.Add(Properties);
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:28,代码来源:FDMenus.cs


示例4: CreateLoginToolWindow

		public static void CreateLoginToolWindow(CommandBarControl cmdBarCtrl,
			CommandBarButton cmdBarBtn, Assembly addIn_Assembly,
			CommandBarControl cmdBarCtrlBackup, CommandBarControl dbCreateDemoDbControl)
		{
			try
			{
				m_AddIn_Assembly = addIn_Assembly;
				m_cmdBarCtrlConnect = cmdBarCtrl;
				m_cmdBarBtnConnect = cmdBarBtn;
				m_cmdBarCtrlBackup = cmdBarCtrlBackup;
				m_cmdBarCtrlCreateDemoDb = dbCreateDemoDbControl;

                loginToolWindow = CreateToolWindow(Common.Constants.CLASS_NAME_LOGIN, Common.Constants.LOGIN, NewFormattedGuid());

                if (loginToolWindow.AutoHides)
				{
                    loginToolWindow.AutoHides = false;
				}
                loginToolWindow.Visible = true;
                loginToolWindow.Width = 460;
                loginToolWindow.Height = 210;
				Helper.CheckIfLoginWindowIsVisible = true;
				
			}
			catch (Exception oEx)
			{
				LoggingHelper.ShowMessage(oEx);
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:29,代码来源:Login.cs


示例5: SetButtonImage

        public static void SetButtonImage(CommandBarButton button, Bitmap image)
        {
            button.FaceId = 0;

            if (image != null)
            {
                image.MakeTransparent(Color.Transparent);
                Clipboard.SetDataObject(image, true);
                button.PasteFace();
            }
        }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:11,代码来源:Menu.cs


示例6: btnConfSettings_Click

 /// <summary>
 /// 会议设置响应事件
 /// </summary>
 /// <param name="Ctrl"></param>
 /// <param name="CancelDefault"></param>
 public static void btnConfSettings_Click(CommandBarButton Ctrl, ref bool CancelDefault)
 {
     ThisAddIn.g_log.Info("operator:btnConfSettingsClicked begin");
     try
     {
         VideoConfSettingsForm videoConfSettings = new VideoConfSettingsForm(null);
         videoConfSettings.ShowDialog();
     }
     catch (Exception ex)
     {
         ThisAddIn.g_log.Error("open VideoConfSettingsForm failed!");
         MessageBox.Show(ex.Message);
     }
     ThisAddIn.g_log.Info("operator:btnConfSettingsClicked end");
 }
开发者ID:eSDK,项目名称:esdk_OutlookPlugin,代码行数:20,代码来源:TPEventHandlers.cs


示例7: btnAbout_Click

 /// <summary>
 /// 关于响应事件
 /// </summary>
 /// <param name="Ctrl"></param>
 /// <param name="CancelDefault"></param>
 public static void btnAbout_Click(CommandBarButton Ctrl, ref bool CancelDefault)
 {
     ThisAddIn.g_log.Info("operator:btnAboutClicked begin");
     try
     {
         AboutBox aboutBox = new AboutBox();
         aboutBox.ShowDialog();
     }
     catch (Exception ex)
     {
         ThisAddIn.g_log.Error(string.Format("open about failed, because {0}", ex.Message));
         MessageBox.Show(ex.Message);
     }
     ThisAddIn.g_log.Info("operator:btnAboutClicked end");
 }
开发者ID:eSDK,项目名称:esdk_OutlookPlugin,代码行数:20,代码来源:TPEventHandlers.cs


示例8: TreeBar

		public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
		{
			this.menus = menus;
			this.treeMenu = treeMenu;

			Refresh = new CommandBarButton("Refresh");
			Refresh.Image = Icons.Refresh.Img;

			EnableTrace = new CommandBarCheckBox(Icons.Debug.Img,"Enable Trace");

			Items.Add(treeMenu.ShowHidden);
			Items.Add(Refresh);
			Items.Add(new CommandBarSeparator());
			Items.Add(menus.ProjectMenu.Properties);
			Items.Add(new CommandBarSeparator());
			Items.Add(EnableTrace);
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:17,代码来源:TreeBar.cs


示例9: VSMenuCommand

 public VSMenuCommand(VSMenu menu, string name, string displayName, string description)
 {
     this._menu = menu;
     this._name = name;
     this._displayName = displayName;
     this._description = description;
     object[] array = new object[0];
     Commands2 commands = (Commands2)menu.VSAddin.ApplicationObject.Commands;
     try
     {
         this._command = commands.AddNamedCommand2(menu.VSAddin.AddInInstance, name, displayName, description, true, 0, ref array, 3, 3, vsCommandControlType.vsCommandControlTypeButton);
     }
     catch
     {
         this._command = commands.Item(menu.VSAddin.AddInInstance.ProgID + "." + name, 0);
     }
     this._button = (CommandBarButton)this._command.AddControl(this._menu.Popup.CommandBar, 1);
 }
开发者ID:postondemand,项目名称:BuildVersionIncrement,代码行数:18,代码来源:VSMenuCommand.cs


示例10: OnProcessText

        public void OnProcessText(CommandBarButton ctrl, ref bool canceldefault)
        {
            var span = new Stopwatch();
            span.Start();

            _application.ScreenUpdating = false;
            var state = _application.ActiveWindow.View.ShowHiddenText;
            _application.ActiveWindow.View.ShowHiddenText = true;

            var changes = RemoveHidden() + RemoveFragments("{}");

            _application.ActiveWindow.View.ShowHiddenText = state;
            _application.ScreenUpdating = true;
            ClearSelection();

            span.Stop();
            var secs = span.ElapsedMilliseconds / 1000d;
            const string Msg = "Deleted {0} fragments\r\nTime spent: {1} sec";
            MessageBox.Show(string.Format(Msg, changes, secs), "Fragments operations");
        }
开发者ID:Dmdv,项目名称:InwordRemover,代码行数:20,代码来源:ApplicationPresenter.cs


示例11: btnHelp_Click

 /// <summary>
 /// 帮助响应事件
 /// </summary>
 /// <param name="Ctrl"></param>
 /// <param name="CancelDefault"></param>
 public static void btnHelp_Click(CommandBarButton Ctrl, ref bool CancelDefault)
 {
     ThisAddIn.g_log.Info("operator:btnHelpClicked begin");
     try
     {
         if (File.Exists(ThisAddIn.helpFilePath))
         {
             System.Diagnostics.Process.Start(ThisAddIn.helpFilePath);
         }
         else
         {
             ThisAddIn.g_log.Error(string.Format("Help .chm can not find."));
             //MessageBox.Show("Help .chm can not find.");
         }
     }
     catch (Exception ex)
     {
         ThisAddIn.g_log.Error(string.Format("Help .chm can not find, cause {0}", ex.Message));
         MessageBox.Show(ex.Message);
     }
     ThisAddIn.g_log.Info("operator:btnHelpClicked end");
 }
开发者ID:eSDK,项目名称:esdk_OutlookPlugin,代码行数:27,代码来源:TPEventHandlers.cs


示例12: AddMenuBar

        private void AddMenuBar()
        {
            try
            {
                Office.CommandBar menubar = (Office.CommandBar)Application.CommandBars.ActiveMenuBar;

                // Add the menu.
                menuCommand = (Office.CommandBarButton)menubar.Controls.Add(
                            Office.MsoControlType.msoControlButton, missing, missing, missing, true);
                menuCommand.Style = MsoButtonStyle.msoButtonIconAndWrapCaptionBelow;
                menuCommand.Caption = Resources.ItemMenu;
                menuCommand.Tag = "200";
                menuCommand.FaceId = 65;
                menuCommand.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(
                            menuCommand_Click);

                this.Enabled = false;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
开发者ID:rbinthrive,项目名称:DClipWord,代码行数:23,代码来源:ThisAddIn.cs


示例13: ProjectContextMenu

		public ProjectContextMenu(FDMenus menus)
		{
			this.menus = menus;

			AddNewClass = CreateButton("New &Class..",Icons.ActionScript.Img);
			AddNewXml = CreateButton("New &Xml File..",Icons.XmlFile.Img);
			AddNewFile = CreateButton("New &File..",Icons.AddFile.Img);
			AddNewFolder = CreateButton("New F&older",Icons.Folder.Img);
			AddLibraryAsset = CreateButton("Library &Asset..",Icons.ImageResource.Img);
			AddExistingFile = CreateButton("&Existing File..",Icons.HiddenFile.Img);
			Open = CreateButton("&Open",Icons.OpenFile.Img);
			Insert = CreateButton("&Insert Into Document",Icons.EditFile.Img);
			Execute = CreateButton("&Execute");
			Cut = CreateButton("Cu&t",Icons.Cut.Img);
			Copy = CreateButton("Cop&y");
			Paste = CreateButton("&Paste",Icons.Paste.Img);
			Delete = CreateButton("&Delete",Icons.Delete.Img);
			Rename = CreateButton("Rena&me");
			AlwaysCompile = new CommandBarCheckBox("Always &Compile");
			AddLibrary = new CommandBarCheckBox("Add to &Library");
			LibraryOptions = CreateButton("&Options...",Icons.Options.Img);
			Hide = new CommandBarCheckBox("&Hide File");
			ShowHidden = new CommandBarCheckBox(Icons.HiddenFile.Img,"&Show Hidden Items");
			NothingToDo = new CommandBarButton("Not a valid group");
			NothingToDo.IsEnabled = false;
			NoProjectOutput = new CommandBarButton("(Project output not built)");
			NoProjectOutput.IsEnabled = false;

			AddMenu = new CommandBarMenu("&Add");
			AddMenu.Items.Add(AddNewClass);
			AddMenu.Items.Add(AddNewXml);
			AddMenu.Items.Add(AddNewFile);
			AddMenu.Items.Add(AddNewFolder);
			AddMenu.Items.AddSeparator();
			AddMenu.Items.Add(AddLibraryAsset);
			AddMenu.Items.Add(AddExistingFile);
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:37,代码来源:ProjectContextMenu.cs


示例14: CreateCommandBar

        /// <summary>
        /// Creates a command-bar.
        /// </summary>
        public void CreateCommandBar()
        {
            string commandBarName = Resources.GetString(ResourceTokens.CommandBarName);
            Object missing = System.Reflection.Missing.Value;
            CommandBar commandBar = VisioUtils.GetCommandBar(Application, commandBarName);

            if (commandBar != null)
                return;

            //adicionar a barra ao Visio
            CommandBars applicationCommandBars = (CommandBars)Application.CommandBars;
            commandBar = applicationCommandBars.Add(commandBarName, MsoBarPosition.msoBarTop, false, true);

            // Validate transition Button
            _validateButton = (CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, missing, missing, 1, false);
            _validateButton.Click += new _CommandBarButtonEvents_ClickEventHandler(this.validateTransition_Click);
            SetButtonProperties(_validateButton, ResourceTokens.ButtonValidate, ResourceTokens.ButtonValidateTooltip, TagValidateButton, "Validate.bmp", "Validate-Mask.bmp");

            // Export transition
            _exportXMLButton = (CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, missing, missing, 2, false);
            _exportXMLButton.Click += new _CommandBarButtonEvents_ClickEventHandler(this.exportTransition_Click);
            SetButtonProperties(_exportXMLButton, ResourceTokens.ButtonExport, ResourceTokens.ButtonExportTooltip, TagExportXMLButton, "Export.bmp", "Export-Mask.bmp");

            // User cannot customize our commandbar
            commandBar.Protection = MsoBarProtection.msoBarNoCustomize;

            // Toolbar is only visible when viewing the drawing
            commandBar.Context = Convert.ToString((short)VisUIObjSets.visUIObjSetDrawing, CultureInfo.InvariantCulture) + "*";

            _application.DocumentCreated += new EApplication_DocumentCreatedEventHandler(_application_DocumentCreated);
            _application.DocumentOpened += new EApplication_DocumentOpenedEventHandler(_application_DocumentOpened);
            _application.BeforeDocumentClose += new EApplication_BeforeDocumentCloseEventHandler(_application_BeforeDocumentClose);
            _application.WindowActivated += new EApplication_WindowActivatedEventHandler(_application_WindowActivated);
            _application.ViewChanged += new EApplication_ViewChangedEventHandler(_application_ViewChanged);
        }
开发者ID:zi-yu,项目名称:midgard,代码行数:38,代码来源:EventSink.cs


示例15: Settings_Click

 private void Settings_Click(CommandBarButton cmdBarbutton, ref bool cancel)
 {
     Settings DialogSettings = new Settings(app);
     DialogSettings.ShowDialog();
     onDocumentLoad();
 }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:6,代码来源:Connect.cs


示例16: Search_Click

 private void Search_Click(CommandBarButton cmdBarbutton, ref bool cancel)
 {
     DialogSearch = new Search(this);
     DialogSearch.ShowDialog();
     onDocumentLoad();
 }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:6,代码来源:Connect.cs


示例17: Save_Click

        private void Save_Click(CommandBarButton cmdBarbutton, ref bool cancel)
        {
            if (app.ActiveWorkbook.FullName.StartsWith(getCacheFolder()))
            {
                makePut();
                return;
            }

            DialogSave = new NSave(this);
            DialogSave.setFileTypes(getFileTypes());
            DialogSave.ShowDialog();
        }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:12,代码来源:Connect.cs


示例18: SaveAs_Click

 private void SaveAs_Click(CommandBarButton cmdBarbutton, ref bool cancel)
 {
     DialogSave = new NSave(this);
     DialogSave.setFileTypes(getFileTypes());
     DialogSave.ShowDialog();
 }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:6,代码来源:Connect.cs


示例19: Open_Click

 private void Open_Click(CommandBarButton cmdBarbutton, ref bool cancel)
 {
     DialogOpen = new NOpen(this);
     DialogOpen.ShowDialog();
     onDocumentLoad();
 }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:6,代码来源:Connect.cs


示例20: About_Click

 private void About_Click(CommandBarButton cmdBarbutton, ref bool cancel)
 {
     AboutBox AboutBox = new AboutBox(app);
     AboutBox.ShowDialog();
 }
开发者ID:exodev,项目名称:jcr-msofficeplugin,代码行数:5,代码来源:Connect.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ContainerControl类代码示例发布时间:2022-05-26
下一篇:
C# Forms.Command类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap