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


C# Forms.ToolStripSplitButton类代码示例

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


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

示例1: NewProgress

 public IProgress<ProgressEventArgs> NewProgress()
 {
     var progressBar = new ToolStripProgressBar();
     var cancelButton = new ToolStripSplitButton { DropDownButtonWidth = 0, Text = "Cancel" };
     cancelButton.ButtonClick += (sender, e) => ((ToolStripItem)sender).Enabled = false;
     StatusBar.AddRange(new ToolStripItem[] { progressBar, cancelButton });
     var progress = new Progress<ProgressEventArgs>((e) =>
     {
         if (e.Continue)
         {
             e.Continue = e.Index < e.Count && cancelButton.Enabled;
             if (e.Continue)
             {
                 progressBar.Maximum = e.Count;
                 progressBar.Value = e.Index;
                 if (e.Success)
                     Model.Modified = true;
             }
             else
             {
                 StatusBar.Remove(cancelButton);
                 StatusBar.Remove(progressBar);
             }
         }
     });
     return progress;
 }
开发者ID:dogbiscuituk,项目名称:TagScanner32767,代码行数:27,代码来源:StatusController.cs

示例2: Init

        public static void Init(ToolStripSplitButton btnHost)
        {
            if(btnHost == null) throw new ArgumentNullException("btnHost");
            m_btnItemsHost = btnHost;

            m_btnItemsHost.DropDownOpening += OnMenuOpening;
        }
开发者ID:earthday,项目名称:keepass2,代码行数:7,代码来源:EntryTemplates.cs

示例3: GetSplitButtonToolBarState

 private static ToolBarState GetSplitButtonToolBarState(ToolStripSplitButton button, bool dropDownButton)
 {
     ToolBarState normal = ToolBarState.Normal;
     if (button != null)
     {
         if (!button.Enabled)
         {
             return ToolBarState.Disabled;
         }
         if (dropDownButton)
         {
             if (button.DropDownButtonPressed || button.ButtonPressed)
             {
                 return ToolBarState.Pressed;
             }
             if (!button.DropDownButtonSelected && !button.ButtonSelected)
             {
                 return normal;
             }
             return ToolBarState.Hot;
         }
         if (button.ButtonPressed)
         {
             return ToolBarState.Pressed;
         }
         if (button.ButtonSelected)
         {
             normal = ToolBarState.Hot;
         }
     }
     return normal;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:ToolStripSystemRenderer.cs

示例4: GetFilterForObjectState

 /// <summary>
 /// Применяет пререданный отфильтрованный список состояний к компоненту формы 
 /// </summary>
 /// <param name="Filter">Фильтр-компонент формы</param>
 /// <param name="FilterObjectStates">Переданный отфильтрованный список</param>
 public void GetFilterForObjectState(ToolStripSplitButton Filter, ArrayList FilterObjectStates)
 {
     if ((Filter == null) || (FilterObjectStates == null))
         return;
     for (ObjectState objectState = ObjectState.Current; objectState <= ObjectState.Canceled; objectState++)
     {
         (Filter.DropDownItems[(int)objectState] as ToolStripMenuItem).Checked = FilterObjectStates.Contains(objectState);
     }
 }
开发者ID:UGTU,项目名称:UGTUKadrProject,代码行数:14,代码来源:IObjectState.cs

示例5: UndoManager

        public UndoManager(ToolStripSplitButton UndoButton, ToolStripSplitButton RedoButton, LevelEditorControl editor)
        {
            undo = UndoButton;
            redo = RedoButton;
            EdControl = editor;

            undo.ButtonClick += new EventHandler(onUndoLast);
            redo.ButtonClick += new EventHandler(onRedoLast);
        }
开发者ID:elfinlazz,项目名称:NSMB-Editor,代码行数:9,代码来源:UndoManager.cs

示例6: Assign

 public bool Assign(string value, ToolStripSplitButton item)
 {
     if (Assign(value, item.PerformButtonClick))
     {
         item.AutoToolTip = true;
         item.ToolTipText = value;
         return true;
     }
     return false;
 }
开发者ID:cyanfish,项目名称:naps2,代码行数:10,代码来源:KeyboardShortcutManager.cs

示例7: Initialize

        private void Initialize ()
        {
            _explorerStrip.Items.Clear();

            List<DataNode> ancestry = new List<DataNode>();
            DataNode node = _rootNode;

            while (node != null) {
                ancestry.Add(node);
                node = node.Parent;
            }

            ancestry.Reverse();

            foreach (DataNode item in ancestry) {
                ToolStripSplitButton itemButton = new ToolStripSplitButton(item.NodePathName) {
                    Tag = item,
                };
                itemButton.ButtonClick += (s, e) => {
                    ToolStripSplitButton button = s as ToolStripSplitButton;
                    if (button != null)
                        SearchRoot = button.Tag as DataNode;
                };
                itemButton.DropDown.ImageList = _iconList;

                if (_explorerStrip.Items.Count == 0)
                    itemButton.ImageIndex = _registry.Lookup(item.GetType());

                if (!item.IsExpanded)
                    item.Expand();

                foreach (DataNode subItem in item.Nodes) {
                    if (!subItem.IsContainerType)
                        continue;

                    ToolStripMenuItem menuItem = new ToolStripMenuItem(subItem.NodePathName) {
                        ImageIndex = _registry.Lookup(subItem.GetType()),
                        Tag = subItem,
                    };
                    menuItem.Click += (s, e) => {
                        ToolStripMenuItem mItem = s as ToolStripMenuItem;
                        if (mItem != null)
                            SearchRoot = mItem.Tag as DataNode;
                    };

                    if (ancestry.Contains(subItem))
                        menuItem.Font = new Font(menuItem.Font, FontStyle.Bold);

                    itemButton.DropDownItems.Add(menuItem);
                }

                _explorerStrip.Items.Add(itemButton);
            }
        }
开发者ID:DMV-Jumbo,项目名称:NBTExplorer,代码行数:54,代码来源:ExplorerBarController.cs

示例8: UndoRedoButtons

 public UndoRedoButtons(UndoManager undoManager,
     ToolStripMenuItem undoMenuItem, ToolStripSplitButton undoButton,
     ToolStripMenuItem redoMenuItem, ToolStripSplitButton redoButton,
     Action<Action> runUIAction)
 {
     _undoManager = undoManager;
     _undoMenuItem = undoMenuItem;
     _undoButton = undoButton;
     _redoMenuItem = redoMenuItem;
     _redoButton = redoButton;
     _runUIAction = runUIAction;
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:12,代码来源:UndoRedoButtons.cs

示例9: ToolStripConnectionGui

        public ToolStripConnectionGui()
        {
            this.mButtonConnect = new ToolStripSplitButton()
            {
                Text = "Connect"
            };
            this.mButtonConnect.ButtonClick += new EventHandler(mButtonConnect_Click);

            this.mComboBoxPort = new ToolStripComboBox()
            {
                ToolTipText = "Port name",
                Size = new Size(300, 23),
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            this.mComboBoxPort.SelectedIndexChanged += new EventHandler(mComboBoxPort_SelectedIndexChanged);

            this.mComboBoxBaudate = new ToolStripComboBox()
            {
                ToolTipText = "Baudrate",
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            this.mComboBoxBaudate.SelectedIndexChanged += new EventHandler(mComboBoxBaudate_SelectedIndexChanged);

            this.mComboBoxParity = new ToolStripComboBox()
            {
                ToolTipText = "Parity",
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            this.mComboBoxParity.SelectedIndexChanged += new EventHandler(mComboBoxParity_SelectedIndexChanged);

            this.mComboBoxStopBits = new ToolStripComboBox()
            {
                ToolTipText = "Stop bits",
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            this.mComboBoxStopBits.SelectedIndexChanged += new EventHandler(mComboBoxStopBits_SelectedIndexChanged);

            this.mMenuItemRtsEnable = new ToolStripMenuItem("RTS");
            this.mMenuItemRtsEnable.Click += new EventHandler(mMenuItemRtsEnable_Click);

            this.mMenuItemDtrEnable = new ToolStripMenuItem("DTR");
            this.mMenuItemDtrEnable.Click += new EventHandler(mMenuItemDtrEnable_Click);

            this.Items.Add(this.mButtonConnect);
            this.mButtonConnect.DropDownItems.AddRange(new ToolStripItem[] { this.mComboBoxPort, this.mComboBoxBaudate, this.mComboBoxParity, this.mComboBoxStopBits, this.mMenuItemRtsEnable, this.mMenuItemDtrEnable });

            this.mWorker = null;
        }
开发者ID:riuson,项目名称:com232term,代码行数:48,代码来源:ToolStripConnectionGui.cs

示例10: GetButtonBackColor

        /// <summary>
        /// Gets a color array based on the state of a split-button
        /// </summary>
        /// <param name="Item">The button to check the state of</param>
        /// <returns></returns>
        private Color[] GetButtonBackColor(ToolStripSplitButton Item, ButtonType Type)
        {
            Color[] Return = new Color[2];

            if (
                (!Item.Selected) &&
                (!Item.ButtonPressed && !Item.DropDownButtonPressed)
                )
            {
                Return[0] = Color.Transparent;
                Return[1] = Color.Transparent;
            }
            else if (
                (Item.Selected) &&
                (!Item.ButtonPressed && !Item.DropDownButtonPressed)
                )
            {
                Return[0] = _sBtnManager.HoverBackgroundTop;
                Return[1] = _sBtnManager.HoverBackgroundBottom;
            }
            else
            {
                if (Item.ButtonPressed)
                {
                    Return[0] = _sBtnManager.ClickBackgroundTop;
                    Return[1] = _sBtnManager.ClickBackgroundBottom;
                }
                else if (Item.DropDownButtonPressed)
                {
                    Return[0] = _mnuManager.MenustripButtonBackground;
                    Return[1] = _mnuManager.MenustripButtonBackground;
                }
            }

            return Return;
        }
开发者ID:nicholatian,项目名称:monody,代码行数:41,代码来源:EasyRenderBase.cs

示例11: CreatePluginItem

 private void CreatePluginItem() {
     if((pluginManager != null) && (PluginManager.ActivatedButtonsOrder.Count > iPluginCreatingIndex)) {
         string pluginID = string.Empty;
         try {
             int num = 0x10000 + iPluginCreatingIndex;
             pluginID = PluginManager.ActivatedButtonsOrder[iPluginCreatingIndex];
             bool flag = (ConfigValues[0] & 0x20) == 0x20;
             bool flag2 = (ConfigValues[0] & 0x10) == 0x10;
             PluginInformation pi = PluginManager.PluginInformations
                     .FirstOrDefault(info => info.PluginID == pluginID);
             if(pi != null) {
                 Plugin plugin;
                 pluginManager.TryGetPlugin(pluginID, out plugin);
                 if(plugin == null) {
                     plugin = pluginManager.Load(pi, null);
                 }
                 if(plugin != null) {
                     bool flag3 = false;
                     IBarDropButton instance = plugin.Instance as IBarDropButton;
                     if(instance != null) {
                         instance.InitializeItem();
                         if(instance.IsSplitButton) {
                             ToolStripSplitButton button2 = new ToolStripSplitButton(instance.Text);
                             button2.ImageScaling = ToolStripItemImageScaling.None;
                             button2.DropDownButtonWidth = LargeButton ? 14 : 11;
                             if(flag2) {
                                 button2.DisplayStyle = instance.ShowTextLabel ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             else {
                                 button2.DisplayStyle = flag ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             button2.ToolTipText = instance.Text;
                             button2.Image = instance.GetImage(LargeButton);
                             button2.Tag = num;
                             DropDownMenuReorderable reorderable = new DropDownMenuReorderable(components);
                             button2.DropDown = reorderable;
                             button2.DropDownOpening += pluginDropDown_DropDownOpening;
                             button2.ButtonClick += pluginButton_ButtonClick;
                             reorderable.ItemClicked += pluginDropDown_ItemClicked;
                             reorderable.ItemRightClicked += pluginDropDown_ItemRightClicked;
                             toolStrip.Items.Add(button2);
                         }
                         else {
                             ToolStripDropDownButton button3 = new ToolStripDropDownButton(instance.Text);
                             button3.ImageScaling = ToolStripItemImageScaling.None;
                             if(flag2) {
                                 button3.DisplayStyle = instance.ShowTextLabel ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             else {
                                 button3.DisplayStyle = flag ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             button3.ToolTipText = instance.Text;
                             button3.Image = instance.GetImage(LargeButton);
                             button3.Tag = num;
                             DropDownMenuReorderable reorderable2 = new DropDownMenuReorderable(components);
                             button3.DropDown = reorderable2;
                             button3.DropDownOpening += pluginDropDown_DropDownOpening;
                             reorderable2.ItemClicked += pluginDropDown_ItemClicked;
                             reorderable2.ItemRightClicked += pluginDropDown_ItemRightClicked;
                             toolStrip.Items.Add(button3);
                         }
                         flag3 = true;
                     }
                     else {
                         IBarButton button4 = plugin.Instance as IBarButton;
                         if(button4 != null) {
                             button4.InitializeItem();
                             ToolStripButton button5 = new ToolStripButton(button4.Text);
                             button5.ImageScaling = ToolStripItemImageScaling.None;
                             if(flag2) {
                                 button5.DisplayStyle = button4.ShowTextLabel ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             else {
                                 button5.DisplayStyle = flag ? ToolStripItemDisplayStyle.ImageAndText : ToolStripItemDisplayStyle.Image;
                             }
                             button5.ToolTipText = button4.Text;
                             button5.Image = button4.GetImage(LargeButton);
                             button5.Tag = num;
                             button5.Click += pluginButton_ButtonClick;
                             toolStrip.Items.Add(button5);
                             flag3 = true;
                         }
                         else {
                             IBarCustomItem item = plugin.Instance as IBarCustomItem;
                             if(item != null) {
                                 DisplayStyle displayStyle = flag2 ? DisplayStyle.SelectiveText : (flag ? DisplayStyle.ShowTextLabel : DisplayStyle.NoLabel);
                                 ToolStripItem item2 = item.CreateItem(LargeButton, displayStyle);
                                 if(item2 != null) {
                                     item2.ImageScaling = ToolStripItemImageScaling.None;
                                     item2.Tag = num;
                                     toolStrip.Items.Add(item2);
                                     flag3 = true;
                                     lstPluginCustomItem.Add(item2);
                                 }
                             }
                             else {
                                 IBarMultipleCustomItems items = plugin.Instance as IBarMultipleCustomItems;
                                 if(items != null) {
                                     DisplayStyle style2 = flag2 ? DisplayStyle.SelectiveText : (flag ? DisplayStyle.ShowTextLabel : DisplayStyle.NoLabel);
                                     int index = pluginManager.IncrementBackgroundMultiple(pi);
//.........这里部分代码省略.........
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:101,代码来源:QTButtonBar.cs

示例12: CreateUndoRedoDropDownMenu

        private void CreateUndoRedoDropDownMenu(ToolStripSplitButton toolStripSplitButton, Stack<APG.CodeHelper.Actions.IAction> sourceItems)
        {
            ToolStripItem tsi;
            toolStripSplitButton.DropDownItems.Clear();

            foreach (APG.CodeHelper.Actions.IAction command in sourceItems)
            {
                tsi = new ToolStripMenuItem();
                tsi.Text = command.ToString();
                toolStripSplitButton.DropDownItems.Add(tsi);
            }
        }
开发者ID:UGTU,项目名称:UGTUKadrProject,代码行数:12,代码来源:KadrBaseForm.cs

示例13: CopyFilter

 private void CopyFilter(ToolStripSplitButton Filter, ToolStripSplitButton TargetFilter)
 {
     for (int i = 0; i < Filter.DropDownItems.Count; i++)
     {
         (TargetFilter.DropDownItems[i] as ToolStripMenuItem).Checked =
             (Filter.DropDownItems[i] as ToolStripMenuItem).Checked;
     }
 }
开发者ID:UGTU,项目名称:UGTUKadrProject,代码行数:8,代码来源:KadrBaseForm.cs

示例14: InitializeComponent


//.........这里部分代码省略.........
       this.Menu_Options = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Options_Settings = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Options_Hotkeys = new System.Windows.Forms.ToolStripMenuItem();
       this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripSeparator();
       this.Menu_Options_ShowPlugins = new System.Windows.Forms.ToolStripMenuItem();
       this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripSeparator();
       this.Menu_Remote = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_Connect = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_Launch = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_Animate = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_PlayTheGame = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_Stop = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_XBOX360_Seperator = new System.Windows.Forms.ToolStripSeparator();
       this.Menu_Remote_PS3_Connect = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_PS3_Animate = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_PS3_PlayTheGame = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_PS3_Stop = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_PS3_Seperator = new System.Windows.Forms.ToolStripSeparator();
       this.Menu_Remote_ExportAndRun = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_Restart = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Remote_ReloadResources = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Help = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Help_iHelp = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Help_VisionDoc = new System.Windows.Forms.ToolStripMenuItem();
       this.toolStripMenuItem21 = new System.Windows.Forms.ToolStripSeparator();
       this.Menu_Help_About = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Tests = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Tests_RunTests = new System.Windows.Forms.ToolStripMenuItem();
       this.Menu_Tests_VideoSize = new System.Windows.Forms.ToolStripMenuItem();
       this.mainToolBar = new System.Windows.Forms.ToolStrip();
       this.ToolBar_Preferences = new System.Windows.Forms.ToolStripButton();
       this.ToolBar_Hotkeys = new System.Windows.Forms.ToolStripButton();
       this.ToolBar_Sep1 = new System.Windows.Forms.ToolStripSeparator();
       this.ToolBar_New = new System.Windows.Forms.ToolStripSplitButton();
       this.ToolBar_NewProject = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_NewScene = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_Open = new System.Windows.Forms.ToolStripSplitButton();
       this.ToolBar_OpenProject = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_OpenScene = new System.Windows.Forms.ToolStripMenuItem();
       this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
       this.ToolBar_Save = new System.Windows.Forms.ToolStripSplitButton();
       this.ToolBar_SaveScene = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_SaveAll = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_SaveAs = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_Export = new System.Windows.Forms.ToolStripSplitButton();
       this.ToolBar_ExportSettings = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_ExportQuick = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_Sep2 = new System.Windows.Forms.ToolStripSeparator();
       this.Toolbar_Cut = new System.Windows.Forms.ToolStripButton();
       this.Toolbar_Copy = new System.Windows.Forms.ToolStripButton();
       this.Toolbar_Paste = new System.Windows.Forms.ToolStripButton();
       this.Toolbar_Delete = new System.Windows.Forms.ToolStripButton();
       this.ToolBar_Sep3 = new System.Windows.Forms.ToolStripSeparator();
       this.Toolbar_Undo = new System.Windows.Forms.ToolStripButton();
       this.Toolbar_Redo = new System.Windows.Forms.ToolStripButton();
       this.ToolBar_Sep4 = new System.Windows.Forms.ToolStripSeparator();
       this.ToolBar_Panels = new System.Windows.Forms.ToolStripDropDownButton();
       this.ToolBar_OpenAssetBrowser = new System.Windows.Forms.ToolStripButton();
       this.ToolBar_Tools = new System.Windows.Forms.ToolStripDropDownButton();
       this.ToolBar_SkyEditor = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_TimeOfDayEditor = new System.Windows.Forms.ToolStripMenuItem();
       this.editFogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_PostProcessor = new System.Windows.Forms.ToolStripMenuItem();
       this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator();
       this.ToolBar_FindShapes = new System.Windows.Forms.ToolStripMenuItem();
       this.ToolBar_FindDuplicates = new System.Windows.Forms.ToolStripMenuItem();
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:67,代码来源:Form1.cs

示例15: LayoutManagerForToolStripSplitButton

        //*************************************************************************
        //  Constructor: LayoutManagerForToolStripSplitButton()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="LayoutManagerForToolStripSplitButton" /> class.
        /// </summary>
        //*************************************************************************
        public LayoutManagerForToolStripSplitButton()
        {
            m_oToolStripSplitButton = null;

            AssertValid();
        }
开发者ID:haisreekanth,项目名称:NetMap,代码行数:14,代码来源:LayoutManagerForToolStripSplitButton.cs


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