當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ToolStripDropDownButton類代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolStripDropDownButton的典型用法代碼示例。如果您正苦於以下問題:C# ToolStripDropDownButton類的具體用法?C# ToolStripDropDownButton怎麽用?C# ToolStripDropDownButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ToolStripDropDownButton類屬於System.Windows.Forms命名空間,在下文中一共展示了ToolStripDropDownButton類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateButton

 public ToolStripItem CreateButton()
 {
     ToolStripDropDownButton menu = new ToolStripDropDownButton (Label);
     foreach (IUserInterfaceItem item in ChildNodes)
         menu.DropDownItems.Add (item.CreateMenuItem ());
     return menu;
 }
開發者ID:wanglehui,項目名稱:mono-addins,代碼行數:7,代碼來源:MenuExtensionNode.cs

示例2: EditorToolStrip

        public EditorToolStrip()
        {
            var dropDown = new ToolStripDropDownButton();
            dropDown.Text = "Style";
            dropDown.Alignment = ToolStripItemAlignment.Right;
            dropDown.DropDownItems.Add("Default");
            dropDown.DropDownItems.Add("GitHub");

            var items = new ToolStripItem[] {
                dropDown,
                new ToolStripMenuItem("Some Button")
            };

            this._dataSourceMock = new Mock<IEditorToolStripDataSource>();
            this._dataSourceMock.Setup(m => m.NumberOfEditorToolStripItems(It.IsAny<Model.EditorToolStrip>()))
                .Returns(items.Length)
                .Verifiable();

            this._dataSourceMock.Setup(m => m.EditorToolStripItemForIndex(It.IsAny<Model.EditorToolStrip>(), It.IsAny<int>()))
                .Returns<Model.EditorToolStrip, int>((inst, index) =>
                {
                    return items[index];
                })
                .Verifiable();

            this._subject = new Model.EditorToolStrip(this._dataSourceMock.Object, null);
        }
開發者ID:pseudomuto,項目名稱:muto-mark,代碼行數:27,代碼來源:EditorToolStrip.cs

示例3: InitMainMenu

        public void InitMainMenu()
        {
            ToolStripDropDownButton tsddbFile = new ToolStripDropDownButton("操作(&F)");
            this.menuBar.Items.Add(tsddbFile);
            tsmiNew = new ToolStripMenuItem("新窗口(&N)");
            tsddbFile.DropDownItems.Add(tsmiNew);
            tsmiNew.Click += new EventHandler(tsmiNew_Click);
            tsmiClose = new ToolStripMenuItem("關閉(&E)");
            tsddbFile.DropDownItems.Add(tsmiClose);
            tsmiClose.Click += new EventHandler(tsmiClose_Click);

            ToolStripDropDownButton tsddbGragh = new ToolStripDropDownButton("趨勢圖(&G)");
            this.menuBar.Items.Add(tsddbGragh);
            tsmiDayLine = new ToolStripMenuItem("日K線(&D)");
            tsddbGragh.DropDownItems.Add(tsmiDayLine);
            tsmiDayLine.Click += new EventHandler(tsmiToDayLine);
            tsmiFiveMinsLine = new ToolStripMenuItem("5分鍾線(&M)");
            tsddbGragh.DropDownItems.Add(tsmiFiveMinsLine);
            tsmiFiveMinsLine.Click += new EventHandler(tsmiToFiveMinsLine);

            ToolStripDropDownButton tsddbTools = new ToolStripDropDownButton("工具(&T)");
            this.menuBar.Items.Add(tsddbTools);
            tsmiFormulaEditor = new ToolStripMenuItem("公式編輯器(&D)");
            tsddbTools.DropDownItems.Add(tsmiFormulaEditor);
            tsmiFormulaEditor.Click += new EventHandler(tsmiOpenFormulaEditor);
        }
開發者ID:inksmallfrog,項目名稱:CSStock,代碼行數:26,代碼來源:StockForm.cs

示例4: ToolStripDropDownButtonPresentation

 /// <summary>
 /// Initializes a new instance of the 'ToolStripDropDownButtonPresentation' class.
 /// </summary>
 /// <param name="toolStripDropDownButton">ToolStripDropDownButton control.</param>
 public ToolStripDropDownButtonPresentation(ToolStripDropDownButton toolStripDropDownButton)
 {
     mToolStripDropDownButton = toolStripDropDownButton;
     if (mToolStripDropDownButton != null)
     {
         mToolStripDropDownButton.Click += new System.EventHandler(HandleDropDownButtonClick);
     }
 }
開發者ID:sgon1853,項目名稱:UPM_MDD_Thesis,代碼行數:12,代碼來源:ToolStripDropDownButtonPresentation.cs

示例5: CreateStatusBarItem

        protected override void CreateStatusBarItem()
        {
            var tempStatusBarItem = new ToolStripDropDownButton();
            tempStatusBarItem.Text = _serialPort.Baud.ToString();
            foreach (var baudRate in BaudRates)
                tempStatusBarItem.DropDownItems.Add(baudRate.ToString());

            tempStatusBarItem.DropDownItemClicked += (sender, args) => SetBaudTo(args.ClickedItem.Text);
            _statusBarItem = tempStatusBarItem;
        }
開發者ID:RJefferys,項目名稱:Hypertoken,代碼行數:10,代碼來源:SerialStatusbarGUI.cs

示例6: TTSFormManager

 public TTSFormManager(System.Windows.Forms.Form mdiparent, System.Windows.Forms.ToolStripDropDownButton workspacedropdown, System.Windows.Forms.ToolStripDropDownButton windowdropdown)
 {
     this.MDIParent = mdiparent;
     this.WorkspaceDropDown = workspacedropdown;
     this.WindowDropDown = windowdropdown;
     this.ClearWindows();
     this.ClearWorkspace();
     this.AddWorkspace(this.CurrentWorkspace, true);
     this.WindowDropDown.Text = "Windows (0)";
 }
開發者ID:jinpan,項目名稱:Traders_IAP,代碼行數:10,代碼來源:TTSFormManager.cs

示例7: InitializeComponent

 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(PropertyVersionFilterControl));
     this.tsTop = new ToolStrip();
     this.tslField = new ToolStripLabel();
     this.tslPropertyName = new ToolStripLabel();
     this.tslIs = new ToolStripLabel();
     this.tsddValueOperation = new ToolStripDropDownButton();
     this.tsmiOperationEquals = new ToolStripMenuItem();
     this.tsmiOperationNotEquals = new ToolStripMenuItem();
     this.tsmiOperationSmaller = new ToolStripMenuItem();
     this.tsmiOperationLarger = new ToolStripMenuItem();
     this.tstbValue = new ToolStripTextBox();
     this.tsTop.SuspendLayout();
     base.SuspendLayout();
     this.tsTop.BackColor = Color.Transparent;
     manager.ApplyResources(this.tsTop, "tsTop");
     this.tsTop.GripStyle = ToolStripGripStyle.Hidden;
     this.tsTop.Items.AddRange(new ToolStripItem[] { this.tslField, this.tslPropertyName, this.tslIs, this.tsddValueOperation, this.tstbValue });
     this.tsTop.Name = "tsTop";
     this.tslField.Name = "tslField";
     manager.ApplyResources(this.tslField, "tslField");
     this.tslPropertyName.Name = "tslPropertyName";
     manager.ApplyResources(this.tslPropertyName, "tslPropertyName");
     this.tslIs.Name = "tslIs";
     manager.ApplyResources(this.tslIs, "tslIs");
     this.tsddValueOperation.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.tsddValueOperation.DropDownItems.AddRange(new ToolStripItem[] { this.tsmiOperationEquals, this.tsmiOperationNotEquals, this.tsmiOperationSmaller, this.tsmiOperationLarger });
     this.tsddValueOperation.Name = "tsddValueOperation";
     manager.ApplyResources(this.tsddValueOperation, "tsddValueOperation");
     this.tsmiOperationEquals.Name = "tsmiOperationEquals";
     manager.ApplyResources(this.tsmiOperationEquals, "tsmiOperationEquals");
     this.tsmiOperationEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationNotEquals.Name = "tsmiOperationNotEquals";
     manager.ApplyResources(this.tsmiOperationNotEquals, "tsmiOperationNotEquals");
     this.tsmiOperationNotEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationSmaller.Name = "tsmiOperationSmaller";
     manager.ApplyResources(this.tsmiOperationSmaller, "tsmiOperationSmaller");
     this.tsmiOperationSmaller.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationLarger.Name = "tsmiOperationLarger";
     manager.ApplyResources(this.tsmiOperationLarger, "tsmiOperationLarger");
     this.tsmiOperationLarger.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tstbValue.BorderStyle = BorderStyle.FixedSingle;
     manager.ApplyResources(this.tstbValue, "tstbValue");
     this.tstbValue.Name = "tstbValue";
     this.tstbValue.TextChanged += new EventHandler(this.tstbValue_TextChanged);
     manager.ApplyResources(this, "$this");
     base.AutoScaleMode = AutoScaleMode.Font;
     base.Controls.Add(this.tsTop);
     base.Name = "PropertyVersionFilterControl";
     this.tsTop.ResumeLayout(false);
     this.tsTop.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:55,代碼來源:PropertyVersionFilterControl.cs

示例8: GetClipboardContentTsmi

 public ToolStripMenuItem GetClipboardContentTsmi(ToolStripDropDownButton tsddb, ClipboardContentEnum et)
 {
     foreach (ToolStripMenuItem tsmi in tsddb.DropDownItems)
     {
         if ((ClipboardContentEnum)tsmi.Tag == et)
         {
             return tsmi;
         }
     }
     return new ToolStripMenuItem();
 }
開發者ID:modulexcite,項目名稱:ZScreen_Google_Code,代碼行數:11,代碼來源:DestSelector.cs

示例9: StreamDetailsControl

        public StreamDetailsControl()
        {
            SuspendLayout();

            _lastWriteTime = new ToolStripLabel();
            _fileSize = new ToolStripLabel();
            _contentType = new ToolStripDropDownButton
            {
                DisplayStyle = ToolStripItemDisplayStyle.Text
            };
            _encoding = new ToolStripLabel();
            _bom = new ToolStripLabel
            {
                Text = "BOM"
            };
            _lineEnding = new ToolStripLabel();

            Items.AddRange(new ToolStripItem[]
            {
                _lastWriteTime,
                _fileSize,
                _contentType,
                _encoding,
                _bom,
                _lineEnding
            });
            Renderer = ToolStripSimpleRenderer.Instance;

            LastWriteTime = null;
            FileSize = null;
            HaveBom = false;
            LineTermination = null;
            Encoding = null;
            ContentType = null;

            ResumeLayout(false);
            PerformLayout();

            foreach (string name in _highlighterNames)
            {
                var item = new ToolStripMenuItem
                {
                    Text = name == _defaultHighlighterName ? Labels.PlainText : name,
                    Tag = name
                };

                item.Click += item_Click;

                _contentType.DropDownItems.Add(item);
            }
        }
開發者ID:netide,項目名稱:netide,代碼行數:51,代碼來源:StreamDetailsControl.cs

示例10: RecentProjectsMenu

 public RecentProjectsMenu() : base(TextHelper.GetString("Label.RecentProjects"))
 {
     ToolbarSelector = new ToolStripDropDownButton();
     ToolbarSelector.Text = TextHelper.GetString("Label.RecentProjects").Replace("&", "");
     ToolbarSelector.DisplayStyle = ToolStripItemDisplayStyle.Image;
     ToolbarSelector.Image = Icons.Project.Img;
     ToolbarSelector.Enabled = false;
     string text = TextHelper.GetString("Label.ClearRecentProjects");
     clearItemMenu = new ToolStripMenuItem(text);
     clearItemMenu.Click += delegate{ ClearAllItems(); };
     clearItemToolbar = new ToolStripMenuItem(text);
     clearItemToolbar.Click += delegate { ClearAllItems(); };
     RebuildList();
 }
開發者ID:heon21st,項目名稱:flashdevelop,代碼行數:14,代碼來源:RecentProjectsMenu.cs

示例11: NuevaBotonDesplegable

 public void NuevaBotonDesplegable(String Nombre, Bitmap Imagen)
 {
     Titulo();
     tsdListaDesplegable = new ToolStripDropDownButton();
     tsdListaDesplegable.Name = Nombre;
     tsdListaDesplegable.Text = "  " + Nombre;
     tsdListaDesplegable.Font = new Font("Century Gothic", 12);
     tsdListaDesplegable.TextAlign = ContentAlignment.MiddleLeft;
     tsdListaDesplegable.Click += new EventHandler(CargarFormulario);
     tsdListaDesplegable.Image = Imagen;
     tsdListaDesplegable.ImageScaling = ToolStripItemImageScaling.None;
     tsdListaDesplegable.ImageAlign = ContentAlignment.MiddleLeft;
     tsdListaDesplegable.ForeColor = Color.LightGray;
     this.MenuAdmin.Items.Add(tsdListaDesplegable);
 }
開發者ID:EbricenterOrg,項目名稱:Seguridad,代碼行數:15,代碼來源:Constructor.cs

示例12: FilterBranchHelper

        public FilterBranchHelper(ToolStripComboBox toolStripBranches, ToolStripDropDownButton toolStripDropDownButton2, RevisionGrid RevisionGrid)
            : this()
        {
            this._NO_TRANSLATE_toolStripBranches = toolStripBranches;
            this._NO_TRANSLATE_toolStripDropDownButton2 = toolStripDropDownButton2;
            this._NO_TRANSLATE_RevisionGrid = RevisionGrid;

            this._NO_TRANSLATE_toolStripDropDownButton2.DropDownItems.AddRange(new ToolStripItem[] {
                this.localToolStripMenuItem,
                this.remoteToolStripMenuItem});

            this._NO_TRANSLATE_toolStripBranches.DropDown += this.toolStripBranches_DropDown;
            this._NO_TRANSLATE_toolStripBranches.TextUpdate += this.toolStripBranches_TextUpdate;
            this._NO_TRANSLATE_toolStripBranches.Leave += this.toolStripBranches_Leave;
            this._NO_TRANSLATE_toolStripBranches.KeyUp += this.toolStripBranches_KeyUp;
        }
開發者ID:Copro,項目名稱:gitextensions,代碼行數:16,代碼來源:FilterBranchHelper.cs

示例13: SetText

        public static void SetText(ToolStripDropDownButton dropdownButton, string text)
        {
            MethodInvoker miSetText = delegate
            {
                dropdownButton.Text = text;
            };

            if (dropdownButton.Owner.InvokeRequired)
            {
                dropdownButton.Owner.Invoke(miSetText);
            }
            else
            {
                miSetText();
            }
        }
開發者ID:NORENBUCH,項目名稱:XrmToolBox,代碼行數:16,代碼來源:ToolStripStatusDelegates.cs

示例14: PathHistoryToolbar

        /// <summary>Initializes a new instance of the <see cref="PathHistoryToolbar"/> class.</summary>
        /// <param name="view">Host history view.</param>
        public PathHistoryToolbar(PathHistoryView view)
        {
            _view = view;

            _view.LogOptionsChanged += OnLogOptionsChanged;

            Items.AddRange(
                new ToolStripItem[]
                {
                    // left-aligned
                    _btnRefresh = new ToolStripButton(Resources.StrRefresh, CachedResources.Bitmaps["ImgRefresh"], OnRefreshButtonClick)
                        {
                            DisplayStyle = ToolStripItemDisplayStyle.Image,
                        },
                    new ToolStripSeparator(),
                    _btnDateOrder = new ToolStripButton(Resources.StrDateOrder, CachedResources.Bitmaps["ImgDateOrder"], OnDateOrderButtonClick)
                        {
                            Checked = _view.LogOptions.Order == RevisionQueryOrder.DateOrder,
                            DisplayStyle = ToolStripItemDisplayStyle.Image,
                        },
                    _btnTopoOrder = new ToolStripButton(Resources.StrTopoOrder, CachedResources.Bitmaps["ImgTopoOrder"], OnTopoOrderButtonClick)
                        {
                            Checked = _view.LogOptions.Order == RevisionQueryOrder.TopoOrder,
                            DisplayStyle = ToolStripItemDisplayStyle.Image,
                        },
                    new ToolStripSeparator(),
                    _btnLimit = new ToolStripDropDownButton(string.Empty, null,
                        new ToolStripItem[]
                        {
                            new ToolStripMenuItem(Resources.StrlUnlimited, null, OnLimitOptionClick) { Tag = 0 },
                            new ToolStripMenuItem( "100 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 100 },
                            new ToolStripMenuItem( "500 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 500 },
                            new ToolStripMenuItem("1000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 1000 },
                            new ToolStripMenuItem("2000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 2000 },
                            new ToolStripMenuItem("5000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 5000 },
                        }),
                    // right-aligned
                    _btnShowDetails = new ToolStripButton(Resources.StrAutoShowDiff, CachedResources.Bitmaps["ImgDiff"], OnShowDetailsButtonClick)
                        {
                            Checked = _view.ShowDetails,
                            DisplayStyle = ToolStripItemDisplayStyle.ImageAndText,
                            Alignment = ToolStripItemAlignment.Right,
                        }
                });
            UpdateLimitButtonText();
        }
開發者ID:Kuzq,項目名稱:gitter,代碼行數:48,代碼來源:PathHistoryToolBar.cs

示例15: FilterBranchHelper

        public FilterBranchHelper(ToolStripComboBox toolStripBranches, ToolStripDropDownButton toolStripDropDownButton2, RevisionGrid RevisionGrid)
            : this()
        {
            this._NO_TRANSLATE_toolStripBranches = toolStripBranches;
            this._NO_TRANSLATE_toolStripDropDownButton2 = toolStripDropDownButton2;
            this._NO_TRANSLATE_RevisionGrid = RevisionGrid;

            this._NO_TRANSLATE_toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.localToolStripMenuItem,
            this.remoteToolStripMenuItem});

            this._NO_TRANSLATE_toolStripBranches.DropDown += new System.EventHandler(this.toolStripBranches_DropDown);
            this._NO_TRANSLATE_toolStripBranches.TextUpdate += new System.EventHandler(this.toolStripBranches_TextUpdate);
            this._NO_TRANSLATE_toolStripBranches.Leave += new System.EventHandler(this.toolStripBranches_Leave);
            this._NO_TRANSLATE_toolStripBranches.KeyUp += new System.Windows.Forms.KeyEventHandler(this.toolStripBranches_KeyUp);

            InitToolStripBranchFilter();
        }
開發者ID:rschoening,項目名稱:gitextensions,代碼行數:18,代碼來源:RevisionGrid.cs


注:本文中的System.Windows.Forms.ToolStripDropDownButton類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。