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


C# Forms.ToolStripButton类代码示例

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


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

示例1: OnBarUpdate

        protected override void OnBarUpdate()
        {
            if (ChartControl == null || _x )
                return;
            if (!ChartControl.Controls.ContainsKey("TSEco_News"))
            {
                _myitem0 = new ToolStripSeparator();
                _myitem0.Name = "TradingStudiesEcoSeparator";

                _myitem1 = new ToolStripButton("Hide News");
                _myitem1.Text = "Hide News";
                _myitem1.Name = "TradingStudiesEcoNews";
                _myitem1.Click += ToolClick1;
                _myitem1.Enabled = true;
                _myitem1.ForeColor = Color.Black;
                _mystrip = (ToolStrip) ChartControl.Controls["tsrTool"];
                _mystrip.Items.Add(_myitem0);
                _mystrip.Items.Add(_myitem1);

                _sp = new Splitter();
                _sp.Name = "TSEco_Splitter";
                _sp.Dock = _dp == DockingPlace.Below ? DockStyle.Bottom : DockStyle.Top;
                ChartControl.Controls.Add(_sp);

                _so = new EcoNewsControl.EcoNewsControl(Cbi.Core.InstallDir + @"\Sounds", Cbi.Core.UserDataDir + @"bin\Custom\");
                _so.Dock = _dp == DockingPlace.Below ? DockStyle.Bottom : DockStyle.Top;
                _so.Name = "TSEco_News";
                ChartControl.Controls.Add(_so);
            }
            else
                _so = ChartControl.Controls["TSEco_News"] as EcoNewsControl.EcoNewsControl;
            _x = true;
        }
开发者ID:redrhino,项目名称:NinjaTrader.Base,代码行数:33,代码来源:EcoNewsIndicator.cs

示例2: PicoTextEditorForm

        public PicoTextEditorForm()
        {
            InitializeComponent();

            AllowBreakpoints = true;

            // Initialize info editor.
            InfoEditor.Visible = Settings.Default.Pico_AutoAssemble;
            InfoEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("Info");

            // Create and initialize Auto-assemble button.
            var b = new ToolStripButton("Auto-assemble");
            b.Checked = Settings.Default.Pico_AutoAssemble;
            b.Click +=
                (sender, e) =>
                {
                    InfoEditor.Visible = !InfoEditor.Visible;

                    b.Checked = InfoEditor.Visible;
                    infoTimer.Enabled = InfoEditor.Visible;
                    if (!InfoEditor.Visible) errorPanel.Visible = false;
                };
            statusStrip.Items.Insert(0, b);

            Editor.Document.DocumentChanged += new ICSharpCode.TextEditor.Document.DocumentEventHandler(Document_DocumentChanged);
        }
开发者ID:lazanet,项目名称:messylab,代码行数:26,代码来源:PicoTextEditorForm.cs

示例3: AddNodeButton

        private void AddNodeButton(MyNodeConfig nodeInfo, bool isTransform)
        {
            ToolStripItem newButton = isTransform ? new ToolStripMenuItem() : newButton = new ToolStripButton();
            ToolStripItemCollection items;

            newButton.Image = nodeInfo.SmallImage;
            newButton.Name = nodeInfo.NodeType.Name;
            newButton.ToolTipText = nodeInfo.NodeType.Name.Substring(2);
            newButton.MouseDown += addNodeButton_MouseDown;
            newButton.Tag = nodeInfo.NodeType;

            newButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            newButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            newButton.ImageTransparentColor = System.Drawing.Color.Magenta;

            if (isTransform)
            {
                newButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                newButton.Text = newButton.ToolTipText;
                items = transformMenu.DropDownItems;
            }
            else
            {
                items = toolStrip1.Items;
                newButton.MouseUp += newButton_MouseUp;
            }

            if (items.Count > 0 && (items[items.Count - 1].Tag as Type).Namespace != nodeInfo.NodeType.Namespace)
            {
                items.Add(new ToolStripSeparator());
            }
            items.Add(newButton);
        }
开发者ID:Jlaird,项目名称:BrainSimulator,代码行数:33,代码来源:GraphLayoutForm_Ops.cs

示例4: TweakExecuteControl

        public TweakExecuteControl(Tweakable tweakable, string currentState)
            : base()
        {
            this.tweakable = tweakable;
            this.state = currentState;
            this.Padding = new Padding(0, 0, 7, 0);

            Text = "execute";

            menu = new ContextMenuStrip();
            menu.ShowCheckMargin = false;
            menu.ShowImageMargin = false;
            menu.ShowItemToolTips = false;

            foreach (string setting in tweakable.GetAvailableSettings())
            {
                ToolStripItem item = new ToolStripButton(setting);
                if (setting == currentState)
                {
                    item.Enabled = false;
                }

                item.Click += Item_Click;

                menu.Items.Add(item);
            }
        }
开发者ID:fub-frank,项目名称:win10-privacy-tweaks,代码行数:27,代码来源:TweakExecuteControl.cs

示例5: FftToolStrip

        public FftToolStrip(GraphControl gc, GraphFFT gf)
        {
            graphControl = gc;
             oldGraph = gf;

             this.fft = new System.Windows.Forms.ToolStripButton();

             this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
             this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fft});
             this.toolStrip.Location = new System.Drawing.Point(0, 0);
             this.toolStrip.Name = "toolStrip2";
             this.toolStrip.Size = new System.Drawing.Size(497, 25);
             this.toolStrip.TabIndex = 1;
             this.toolStrip.Text = "toolStrip2";

             //
             // fft
             //
             this.fft.CheckOnClick = true;
             this.fft.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
             this.fft.Image = null;// ((System.Drawing.Image)(resources.GetObject("fft.Image")));
             this.fft.ImageTransparentColor = System.Drawing.Color.Magenta;
             this.fft.Name = "fft";
             this.fft.Size = new System.Drawing.Size(30, 22);
             this.fft.Text = "FFT";
             this.fft.CheckStateChanged += new System.EventHandler(this.fft_CheckStateChanged);
        }
开发者ID:karawin,项目名称:xoscillo,代码行数:28,代码来源:FftToolstrip.cs

示例6: ZoomAdaptor

        public ZoomAdaptor(PicView picView, 
            ToolStripButton plusBtn,
            ToolStripButton minusBtn,
            ToolStripComboBox combox)
        {
            this.picView = picView;
            //this.form = form;
            this.plusBtn = plusBtn;
            this.minusBtn = minusBtn;
            this.combox = combox;

            picView.ZoomChanged += new EventHandler(zoomChanged);

            plusBtn.Click += new EventHandler(btnClick);
            minusBtn.Click += new EventHandler(btnClick);

            combox.DropDownStyle = ComboBoxStyle.DropDown;
            combox.DropDownHeight = 200;
            for(int i=20; i<=100; i+=20){
                combox.Items.Add(i.ToString() + "%");
            }

            combox.SelectedIndexChanged += new EventHandler(comboxTextUpdate);
            combox.Leave += new EventHandler(comboxTextUpdate);
            combox.KeyDown += new KeyEventHandler(comboxKeyDown);

            renew();
        }
开发者ID:noodlefighter,项目名称:LabelPlus,代码行数:28,代码来源:ZoomAdaptor.cs

示例7: RegisterToolBoxButton

        ///<summary>
        ///  Registers new Tool Box button in main tool-set
        ///</summary>
        ///<param name="ownControl">Control owns button will be created</param>
        ///<param name="item">Instance of <see cref="ToolStripMenuItem"/> which provides information to create button</param>
        ///<param name="action">Action should be call when created button clicked</param>
        ///<returns>Action delegate to notify main form when created button should be enabled/disabled</returns>
        ///<exception cref="FireFlyException"></exception>
        public Action<bool> RegisterToolBoxButton([NotNull]Control ownControl, [NotNull]ToolStripMenuItem item, [CanBeNull]EventHandler action)
        {
            var nb = new ToolStripButton(item.Text, item.Image) { Name = item.Name, ToolTipText = item.ToolTipText, Tag = ownControl, Visible = false};
            if (item.ShortcutKeys != Keys.None)
            {
#if CHECKERS
                if (nb.ToolTipText.IsNull())
                {
                    throw new FireFlyException("{0} has empty ToolTipText property", nb.Name);
                }
#endif
                nb.ToolTipText += " (" + new KeysConverter().ConvertToString(item.ShortcutKeys) + ")";
            }
            nb.DisplayStyle = item.Image != null ? ToolStripItemDisplayStyle.Image : ToolStripItemDisplayStyle.Text;
            nb.Click += action ?? ((s, e) => item.PerformClick());
            nb.Enabled = item.Visible && item.Enabled;
            tsMain.Items.Add(nb);

            ownControl.GotFocus += (s, e) => nb.Visible = true;
            ownControl.LostFocus += (s, e) =>
            {
                nb.Visible = false;
            };
            ownControl.Disposed += (s, e) => nb.Dispose();

            return isActive =>
            {
                nb.Enabled = isActive;
                item.Visible = isActive;
            };
        }
开发者ID:supermuk,项目名称:iudico,代码行数:39,代码来源:MainForm.cs

示例8: initializeToolStripButtons

		protected override void initializeToolStripButtons() {
			_tsBtnEditPackage = createToolStripButton("Updatepaket bearbeiten");
			_tsBtnRemovePackage = createToolStripButton("Entfernen", "Entfernt des Updatepaket aus dem Projekt.");

			_tsBtnEditPackage.Click += _tsBtnEditPackage_Click;
			_tsBtnRemovePackage.Click += _tsBtnRemovePackage_Click;
		}
开发者ID:Taipi88,项目名称:updateSystem.NET,代码行数:7,代码来源:updateSubPage.cs

示例9: ToolStripViewGui

        public ToolStripViewGui()
        {
            this.Settings = Options.Instance.ViewOptions;

            this.mButtonShowLastPackets = new ToolStripButton()
            {
                Text = "Last packets",
                Checked = this.Settings.ShowLastPackets
            };
            this.mButtonShowLastPackets.Click += new EventHandler(mButtonShowLastPackets_Click);

            this.mButtonShowStaticPackets = new ToolStripButton()
            {
                Text = "Static packets",
                Checked = this.Settings.ShowStaticPackets
            };
            this.mButtonShowStaticPackets.Click += new EventHandler(mButtonShowStaticPackets_Click);

            this.mButtonAbout = new ToolStripButton()
            {
                Text = "About"
            };
            this.mButtonAbout.Click += new EventHandler(mButtonAbout_Click);

            this.Items.AddRange(new ToolStripItem[] { this.mButtonShowLastPackets, this.mButtonShowStaticPackets, this.mButtonAbout });
        }
开发者ID:riuson,项目名称:com232term,代码行数:26,代码来源:ToolStripViewGui.cs

示例10: CreateToolStripButton

 private static ToolStripButton CreateToolStripButton(string text, EventHandler onClick = null)
 {
     ToolStripButton button = new ToolStripButton();
     button.Text = text;
     button.Click += onClick;
     return button;
 }
开发者ID:labeuze,项目名称:source,代码行数:7,代码来源:RunSourceStatus.cs

示例11: addtoolstripitem

        private void addtoolstripitem(string name, object classobject)
        {
            if (name == "Seperator")
                Items.Add(new ToolStripSeparator());
            else
            {
                bool merge = typeof (MainForm) != classobject.GetType();

                var toolstripbutton = new ToolStripButton(name) {Name = name};
                EventInfo eventinfo = toolstripbutton.GetType().GetEvent("Click");
                // Zoek de string.Format("{0}_Click", name.Replace(" ", "")) methode van classobject
                MethodInfo methodinfo =
                    classobject.GetType().GetMethod(string.Format("{0}_Click", name.Replace(" ", "")));

                if (methodinfo == null) // Als die niet bestaat.
                    toolstripbutton.Enabled = false;
                else // Anders, voeg een EventHandler toe van het Click event naar die methode.
                    eventinfo.AddEventHandler(toolstripbutton,
                                              Delegate.CreateDelegate(eventinfo.EventHandlerType, classobject,
                                                                      methodinfo));

                if (merge)
                    toolstripbutton.MergeAction = MergeAction.Replace;

                Items.Add(toolstripbutton);
                itemdictionary.Add(name, toolstripbutton);
            }
        }
开发者ID:afraca,项目名称:Traffic_Simulation,代码行数:28,代码来源:TaskMenu.cs

示例12: PHPToolBar

        public PHPToolBar()
        {
            App = (FireEditApplication)FireEditApplication.Istance;

            btnCheckSyntax = new ToolStripButton(Properties.Resources.document_check);
            btnCheckSyntax.Click += new EventHandler(_CheckSyntax_Click);
            btnCheckSyntax.Size = new System.Drawing.Size(22, 22);
            btnCheckSyntax.ToolTipText = "Check Syntax Only";

            this.Items.Add(btnCheckSyntax);
            this.Items.Add("-");

            btnRunScript = new ToolStripButton(Properties.Resources.RunScript);
            btnRunScript.ToolTipText = "Run Script";

            this.Items.Add(btnRunScript);

            btnRunScript.Click += new EventHandler(btnRunScript_Click);


            this.ImageScalingSize = App.MainForm.MainToolStrip.ImageScalingSize;

            this.Size = new Size(10, 25);


            this.AutoSize = true;
        }
开发者ID:viticm,项目名称:pap2,代码行数:27,代码来源:PHPToolBar.cs

示例13: SubmodulesToolbar

        /// <summary>Initializes a new instance of the <see cref="SubmodulesToolbar"/> class.</summary>
        /// <param name="submodulesView">Host view.</param>
        public SubmodulesToolbar(SubmodulesView submodulesView)
        {
            Verify.Argument.IsNotNull(submodulesView, "submodulesView");

            _submodulesView = submodulesView;

            Items.Add(new ToolStripButton(Resources.StrRefresh, CachedResources.Bitmaps["ImgRefresh"],
                (sender, e) =>
                {
                    _submodulesView.RefreshContent();
                })
                {
                    DisplayStyle = ToolStripItemDisplayStyle.Image,
                });
            Items.Add(new ToolStripSeparator());
            Items.Add(_btnAddSubmodule = new ToolStripButton(Resources.StrAddSubmodule, CachedResources.Bitmaps["ImgSubmoduleAdd"],
                (sender, e) =>
                {
                    using(var dlg = new AddSubmoduleDialog(_submodulesView.Repository))
                    {
                        dlg.Run(_submodulesView);
                    }
                })
                {
                    DisplayStyle = ToolStripItemDisplayStyle.ImageAndText,
                });
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:29,代码来源:SubmodulesToolBar.cs

示例14: ToolStripButtonBlink

 public ToolStripButtonBlink(ref ContainerControl ParentControl, ref ToolStripButton TSButton, Image[] ImList)
     : this(ref ParentControl, 
         ref TSButton, 
         ImList,
         new[] {TSButton.ForeColor})
 {
 }
开发者ID:IsaacSanch,项目名称:KoruptLib,代码行数:7,代码来源:IconBlink.cs

示例15: StringEditor

        public StringEditor()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StringEditor));
            txtText = new TextBox();
            txtText.Top = 5;
            txtText.Left = 50;
            txtText.Width = 140;
            txtText.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top|AnchorStyles.Right;
            txtText.TextChanged += TxtText_TextChanged;
            Controls.Add(txtText);

            ToolStrip tlsInsert = new ToolStrip();
            insertButton = new ToolStripButton();

            insertButton.Click += InsertButton_Click;

            insertButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            insertButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSplitButton1.Image")));
            insertButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            insertButton.Size = new System.Drawing.Size(32, 22);

            tlsInsert.Dock = DockStyle.None;
            tlsInsert.Items.Add(insertButton);
            tlsInsert.Location = new System.Drawing.Point(0, 2);

            Controls.Add(tlsInsert);
        }
开发者ID:jakakordez,项目名称:Eternal,代码行数:27,代码来源:StringEditor.cs


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