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

C# Forms.ToolBarButton类代码示例

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

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



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

示例1: IDialog

        public IDialog()
            : base()
        {
            // Button
            resultButton = new ResultButton();
            this.Controls.Add(resultButton);

            this.toolBar = new System.Windows.Forms.ToolBar();
            this.tbOkButton = new System.Windows.Forms.ToolBarButton();
            this.tbCancelButton = new System.Windows.Forms.ToolBarButton();

            //
            // toolBar
            //
            this.toolBar.Buttons.Add(this.tbOkButton);
            this.toolBar.Buttons.Add(this.tbCancelButton);
            this.toolBar.Name = "toolBar";
            this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);

            this.Controls.Add(this.toolBar);

            // Toolbar
            string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
            ToolbarMaker.ToolBar = toolBar;
            ToolbarMaker.AddIcon(appPath + @"\Icons\tbOk");
            ToolbarMaker.AddIcon(appPath + @"\Icons\tbCancel");

            this.TopMost = true;
        }
开发者ID:ntj,项目名称:GravurGIS,代码行数:29,代码来源:IDialog.cs


示例2: Install

		public void Install(IWorkspace workspace)
		{
			MenuItem item = new MenuItem("P&roject");
			workspace.MainMenu.MenuItems.Add(item);

			ToolBar toolbar = workspace.MainToolBar;

			newAction.Install(workspace, item, toolbar);
			openAction.Install(workspace, item, toolbar);
			saveAction.Install(workspace, item, toolbar);

			MenuItem menuSep = new MenuItem("-");
			item.MenuItems.Add(menuSep);

			generateAction.Install(workspace, item, toolbar);

			menuSep = new MenuItem("-");
			item.MenuItems.Add(menuSep);

			exitAction.Install(workspace, item, toolbar);

			ToolBarButton sep = new ToolBarButton();
			sep.Style = ToolBarButtonStyle.Separator;
			
			toolbar.Buttons.Add( sep );
		}
开发者ID:ralescano,项目名称:castle,代码行数:26,代码来源:FileActionSet.cs


示例3: MyWindow

        public MyWindow()
            : base()
        {
            Menu = new MainMenu();
            Menu.MenuItems.Add("File");
            Menu.MenuItems.Add("Edit");
            Menu.MenuItems.Add("View");
            Menu.MenuItems.Add("Help");

            Bitmap bm = new Bitmap(GetType(), "SimpleToolbar.bmp");
            ImageList imglist = new ImageList();
            imglist.Images.AddStrip(bm);
            imglist.TransparentColor = Color.LightBlue;
            ToolBar tb = new ToolBar();
            tb.Parent = this;
            tb.ShowToolTips = true;
            string[] astr = { "New", "Open", "Save", "Print", "Cut", "Copy", "Paste" };
            for (int i = 0; i < 7; i++)
            {
                ToolBarButton tbb = new ToolBarButton();
                tbb.ImageIndex = i;
                tbb.ToolTipText = astr[i];
                tb.Buttons.Add(tbb);
            }
        }
开发者ID:kmrashish,项目名称:DotNetLab,代码行数:25,代码来源:Program.cs


示例4: InitializeMyToolBar

		static public void InitializeMyToolBar(Form form)
		{
			// Create and initialize the ToolBar and ToolBarButton controls.
			ToolBar toolBar1 = new ToolBar();
			ToolBarButton toolBarButton1 = new ToolBarButton();
			ToolBarButton toolBarButton2 = new ToolBarButton();
			ToolBarButton toolBarButton3 = new ToolBarButton();
	
			// Set the Text properties of the ToolBarButton controls.
			toolBarButton1.Text = "Open";
			toolBarButton2.Text = "Save";
			toolBarButton3.Text = "Print";
	
			// Add the ToolBarButton controls to the ToolBar.
			toolBar1.Buttons.Add(toolBarButton1);
			toolBar1.Buttons.Add(toolBarButton2);
			toolBar1.Buttons.Add(toolBarButton3);
	
			//Add the event-handler delegate.
			toolBar1.ButtonClick += new ToolBarButtonClickEventHandler (
			  toolBar1_ButtonClick);
	
			// Add the ToolBar to the Form.
			form.Controls.Add(toolBar1);
 		}
开发者ID:mono,项目名称:uia2atk,代码行数:25,代码来源:FormTest.cs


示例5: SetWholeDropDown

        public void SetWholeDropDown(ToolBarButton button)
        {
            if (button == null)
            {
                throw new ArgumentNullException("button");
            }

            if (!this.wholeDropDownButtons.Contains(button))
            {
                this.wholeDropDownButtons.Add(button);

                if (!OsUtils.Windows())
                {
                    // Append a down arrow as BTNS_WHOLEDROPDOWN is only supported under Windows
                    button.Text += " ▾";
                }
            }

            NativeMethods.TBBUTTONINFO buttonInfo = default(NativeMethods.TBBUTTONINFO);

            buttonInfo.cbSize = Marshal.SizeOf(buttonInfo);
            buttonInfo.dwMask = NativeMethods.TBIF_STYLE | NativeMethods.TBIF_BYINDEX;
            buttonInfo.fsStyle = NativeMethods.BTNS_WHOLEDROPDOWN | NativeMethods.BTNS_AUTOSIZE;

            NativeMethods.SendMessage(this.Handle, NativeMethods.TB_SETBUTTONINFO, (IntPtr)this.Buttons.IndexOf(button), ref buttonInfo);
        }
开发者ID:ribbons,项目名称:RadioDownloader,代码行数:26,代码来源:ExtToolBar.cs


示例6: TBBStylesForm

		public TBBStylesForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			string[] astrTBB = {"Cut", "Copy", "Paste", "", "Messages", "", "Help"};
			ToolBarButtonStyle[] atbbStyles = {ToolBarButtonStyle.PushButton,
				ToolBarButtonStyle.PushButton, ToolBarButtonStyle.PushButton,
				ToolBarButtonStyle.Separator, ToolBarButtonStyle.ToggleButton,
				ToolBarButtonStyle.Separator, ToolBarButtonStyle.DropDownButton };
			int[] anImageIndex = { 0, 1, 2, 0, 4, 0, 3 };

			for (int i=0; i < astrTBB.Length; i++)
			{
				ToolBarButton tbb = new ToolBarButton();
				tbb.ImageIndex = anImageIndex[i];
				tbb.Style = atbbStyles[i];
				tbb.ToolTipText = astrTBB[i];
				if (tbb.Style == ToolBarButtonStyle.DropDownButton)
				{
					tbb.DropDownMenu = ddmDemo;
				}
				tbMain.Buttons.Add(tbb);
			}
		
		}
开发者ID:ppatoria,项目名称:SoftwareDevelopment,代码行数:28,代码来源:MAIN.CS


示例7: PtxToolButton

 public PtxToolButton(PtCommand cmd)
 {
     m_Command = cmd;
     m_Button = new ToolBarButton();
     m_Button.Text = m_Command.DisplayName;
     m_Command.AddObserver(this);
 }
开发者ID:JeffreyZksun,项目名称:opendraw,代码行数:7,代码来源:PtxToolButton.cs


示例8: Initialize

		public override void Initialize() {
			AutoScrollCanvas = true;
			windowSD = ScrollControl.ScrollDirector;
			documentSD = new DocumentScrollDirector();

			ToolBar toolBar = new ToolBar();
			ToolBarButton btnWindow = new ToolBarButton(WINDOW_LABEL);
			ToolBarButton btnDocument = new ToolBarButton(DOCUMENT_LABEL);
			toolBar.Buttons.Add(btnWindow);
			toolBar.Buttons.Add(btnDocument);
			toolBar.ButtonClick += new ToolBarButtonClickEventHandler(toolBar_ButtonClick);
			this.Controls.Add(toolBar);

			ScrollControl.Bounds = new Rectangle(ClientRectangle.X, toolBar.Bottom, ScrollControl.Width, ScrollControl.Height - toolBar.Height);

			// Make some rectangles on the surface so we can see where we are
			for (int x = 0; x < 20; x++) {
				for (int y = 0; y < 20; y++) {
					if (((x + y) % 2) == 0) {
						PPath path = PPath.CreateRectangle(50 * x, 50 * y, 40, 40);
						path.Brush = Brushes.Blue;
						path.Pen = Pens.Black;
						Canvas.Layer.AddChild(path);
					}
					else if (((x + y) % 2) == 1) {
						PPath path = PPath.CreateEllipse(50 * x, 50 * y, 40, 40);
						path.Brush = Brushes.Blue;
						path.Pen = Pens.Black;
						Canvas.Layer.AddChild(path);
					}
				}
			}
		}
开发者ID:malacandrian,项目名称:Piccolo.NET,代码行数:33,代码来源:ScrollingExample.cs


示例9: Form1

        public Form1()
        {
            InitializeComponent();
            list = new ImageList();
            list.ImageSize = new Size(50, 50);
            list.Images.Add(new Bitmap("open.bmp"));
            list.Images.Add(new Bitmap("save.bmp"));
            list.Images.Add(new Bitmap("exit.bmp"));

            tBar = new ToolBar();
                        
            tBar.ImageList = list; //привяжем список картинок к тулбару
            ToolBarButton toolBarButton1 = new ToolBarButton();
            ToolBarButton toolBarButton2 = new ToolBarButton();
            ToolBarButton toolBarButton3 = new ToolBarButton();
            ToolBarButton separator = new ToolBarButton();
            separator.Style = ToolBarButtonStyle.Separator;

            toolBarButton1.ImageIndex = 0; //Open
            toolBarButton2.ImageIndex = 1;// save
            toolBarButton3.ImageIndex = 2; //exit

            tBar.Buttons.Add(toolBarButton1);
            tBar.Buttons.Add(separator);
            tBar.Buttons.Add(toolBarButton2);
            tBar.Buttons.Add(separator);
            tBar.Buttons.Add(toolBarButton3);

            tBar.Appearance = ToolBarAppearance.Flat;
            tBar.BorderStyle = BorderStyle.Fixed3D;
            tBar.ButtonClick += new ToolBarButtonClickEventHandler(tBar_ButtonClick); 
            
            this.Controls.Add(tBar);
            
        }
开发者ID:xs2ranjeet,项目名称:13ns9-1spr,代码行数:35,代码来源:Form1.cs


示例10: Install

  { public static void Install (Panel ParentArg)
    { T_New New = new T_New (0) ;
      T_Open Open = new T_Open (1) ;
      T_Save Save = new T_Save (2) ;
      T_SaveAll SaveAll = new T_SaveAll (3) ;
      T_Close Close = new T_Close (4) ;
      T_Cut Cut = new T_Cut (5) ;
      T_Copy Copy = new T_Copy (6) ;
      T_Paste Paste = new T_Paste (7) ;
      T_Undo Undo = new T_Undo (8) ;
      T_ColorHighlighter ColorHighlighter = new T_ColorHighlighter (9) ;
      T_Search Search = new T_Search (10) ;
      T_Print Print = new T_Print (11) ;

      ToolBarButton Spacer = new ToolBarButton () ;
      Spacer.Style = ToolBarButtonStyle.Separator ;

      ImageList List = new ImageList () ;

      List.Images.Add (New.GetBMP()) ;
      List.Images.Add (Open.GetBMP()) ;
      List.Images.Add (Save.GetBMP()) ;
      List.Images.Add (SaveAll.GetBMP()) ;
      List.Images.Add (Close.GetBMP()) ;
      List.Images.Add (Cut.GetBMP()) ;
      List.Images.Add (Copy.GetBMP()) ;
      List.Images.Add (Paste.GetBMP()) ;
      List.Images.Add (Undo.GetBMP()) ;
      List.Images.Add (ColorHighlighter.GetBMP()) ;
      List.Images.Add (Search.GetBMP()) ;
      List.Images.Add (Print.GetBMP()) ;

      ToolBar Bar = new ToolBar () ;

      Bar.Parent = ParentArg ;
      Bar.ImageList = List ;
      Bar.ShowToolTips = true ;
      Bar.ButtonClick += new ToolBarButtonClickEventHandler (BarClick) ;

      Bar.Buttons.Add (New) ; 
      Bar.Buttons.Add (Open) ; 
      Bar.Buttons.Add (Save) ; 
      Bar.Buttons.Add (SaveAll) ; 
      Bar.Buttons.Add (Close) ;
 
      Bar.Buttons.Add (Spacer) ;
 
      Bar.Buttons.Add (Cut) ; 
      Bar.Buttons.Add (Copy) ; 
      Bar.Buttons.Add (Paste) ; 

      Bar.Buttons.Add (Spacer) ;
 
      Bar.Buttons.Add (Undo) ; 
      Bar.Buttons.Add (ColorHighlighter) ; 
      Bar.Buttons.Add (Search) ; 
      Bar.Buttons.Add (Print) ; 
    }
开发者ID:kcb146,项目名称:editor,代码行数:58,代码来源:ToolBar_Manager.CS


示例11: InitializeComponent

    /// <summary> 
    /// Required method for Designer support - do not modify 
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent() {
      this.components = new System.ComponentModel.Container();
      System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof (ListToolBarControl));
      this.toolBar = new System.Windows.Forms.ToolBar();
      this.tbtnPasteList = new System.Windows.Forms.ToolBarButton();
      this.tbtnSeparator = new System.Windows.Forms.ToolBarButton();
      this.imageList = new System.Windows.Forms.ImageList(this.components);
      this.tbtnAppendList = new System.Windows.Forms.ToolBarButton();
      this.SuspendLayout();
      // 
      // toolBar
      // 
      this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[]{
        this.tbtnPasteList,
        this.tbtnAppendList,
        this.tbtnSeparator
      });
      this.toolBar.DropDownArrows = true;
      this.toolBar.ImageList = this.imageList;
      this.toolBar.Location = new System.Drawing.Point(0, 0);
      this.toolBar.Name = "toolBar";
      this.toolBar.ShowToolTips = true;
      this.toolBar.Size = new System.Drawing.Size(64, 30);
      this.toolBar.TabIndex = 0;
      this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
      // 
      // tbtnPasteList
      // 
      this.tbtnPasteList.ImageIndex = 0;
      this.tbtnPasteList.Tag = "PasteList";
      this.tbtnPasteList.ToolTipText = "Paste list";
      // 
      // tbtnSeparator
      // 
      this.tbtnSeparator.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
      // 
      // imageList
      // 
      this.imageList.ImageSize = new System.Drawing.Size(19, 18);
      this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
      // 
      // tbtnAppendList
      // 
      this.tbtnAppendList.ImageIndex = 1;
      this.tbtnAppendList.Tag = "AppendList";
      this.tbtnAppendList.ToolTipText = "Append list";
      // 
      // ListToolBarControl
      // 
      this.Controls.Add(this.toolBar);
      this.Name = "ListToolBarControl";
      this.Size = new System.Drawing.Size(64, 32);
      this.ResumeLayout(false);

    }
开发者ID:satr,项目名称:regexexplorer,代码行数:60,代码来源:ListToolBarControl.cs


示例12: Text

		public void Text ()
		{
			ToolBarButton tbb = new ToolBarButton ();
			Assert.AreEqual ("", tbb.Text, "A1");

			tbb.Text = "hi there";
			Assert.AreEqual ("hi there", tbb.Text, "A2");

			tbb.Text = null;
			Assert.AreEqual ("", tbb.Text, "A3");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:ToolBarButtonTest.cs


示例13: Name

		public void Name ()
		{
			ToolBarButton tbb = new ToolBarButton ();
			Assert.AreEqual ("", tbb.Name, "A1");
			tbb.Name = "abc";
			Assert.AreEqual ("abc", tbb.Name, "A2");
			tbb.Name = "";
			Assert.AreEqual ("", tbb.Name, "A3");
			tbb.Name = null;
			Assert.AreEqual ("", tbb.Name, "A4");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:ToolBarButtonTest.cs


示例14: Init

        public void Init()
        {
            var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));

            this.Name = "toolbar";
            this.ImageList = new ImageList();
            this.ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("defaultImage.ImageStream")));
            this.Appearance = ToolBarAppearance.Flat;

            this.EditState = initEditStateButton("editstate");
            this.AppSettings = initAppSettingsButton("appsettings");
            this.Save = initSaveButton("save");
            this.SaveAs = initSaveAsButton("saveAs");
            this.Open = initOpenButton("open");
            this.QuadTree = initQuadTreeButton("quadtree");

            this.Buttons.Add(EditState);
            this.Buttons.Add(AppSettings);
            this.Buttons.Add(initSeperator("seperator1"));
            this.Buttons.Add(Save);
            this.Buttons.Add(SaveAs);
            this.Buttons.Add(Open);
            this.Buttons.Add(initSeperator("seperator2"));
            this.Buttons.Add(QuadTree);

            this.ButtonClick += (object sender, ToolBarButtonClickEventArgs e) =>
            {
                if (e.Button.Name == "editstate")
                {
                    this.buttonEditStateHandleClick(sender, e);
                }
                else if (e.Button.Name == "appsettings")
                {
                    this.buttonAppSettingsHandleClick(sender, e);
                }
                else if (e.Button.Name == "save")
                {
                    this.buttonSaveHandleClick(sender, e);
                }
                else if (e.Button.Name == "saveAs")
                {
                    this.buttonSaveAsHandleClick(sender, e);
                }
                else if (e.Button.Name == "open")
                {
                    this.buttonOpenHandleClick(sender, e);
                }
                else if (e.Button.Name == "quadtree")
                {
                    this.buttonQuadtreeHandleClick(sender, e);
                }
            };
        }
开发者ID:7ung,项目名称:NMGAME,代码行数:53,代码来源:METoolbar.cs


示例15: InitializeComponent

 private void InitializeComponent() {
     this.components = new Container();
     ResourceManager resources = new ResourceManager(typeof (ScalerToolBarControl));
     this.toolBar = new ToolBar();
     this.tbtnScaleUp = new ToolBarButton();
     this.tbtnScaleDown = new ToolBarButton();
     this.imageList = new ImageList(this.components);
     this.SuspendLayout();
     // 
     // toolBar
     // 
     this.toolBar.Buttons.AddRange(new ToolBarButton[] {
                                                           this.tbtnScaleUp,
                                                           this.tbtnScaleDown
                                                       });
     this.toolBar.DropDownArrows = true;
     this.toolBar.ImageList = this.imageList;
     this.toolBar.Location = new Point(0, 0);
     this.toolBar.Name = "toolBar";
     this.toolBar.ShowToolTips = true;
     this.toolBar.Size = new Size(56, 30);
     this.toolBar.TabIndex = 0;
     this.toolBar.ButtonClick += new ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
     // 
     // tbtnScaleUp
     // 
     this.tbtnScaleUp.ImageIndex = 0;
     this.tbtnScaleUp.Tag = "ScaleUp";
     this.tbtnScaleUp.ToolTipText = "Scale up";
     // 
     // tbtnScaleDown
     // 
     this.tbtnScaleDown.ImageIndex = 1;
     this.tbtnScaleDown.Tag = "ScaleDown";
     this.tbtnScaleDown.ToolTipText = "Scale down";
     // 
     // imageList
     // 
     this.imageList.ImageSize = new Size(19, 18);
     this.imageList.ImageStream = ((ImageListStreamer) (resources.GetObject("imageList.ImageStream")));
     this.imageList.TransparentColor = Color.Transparent;
     // 
     // ScalerToolBarControl
     // 
     this.Controls.Add(this.toolBar);
     this.Name = "ScalerToolBarControl";
     this.Size = new Size(56, 32);
     this.ResumeLayout(false);
 }
开发者ID:satr,项目名称:regexexplorer,代码行数:49,代码来源:ScalerToolBarControl.cs


示例16: SetUp

		public override void SetUp ()
		{
			base.SetUp ();

			menuButton = null;
			toolBar = new ToolBar ();
			toolBarButton = new ToolBarButton ("Button");
			toolBar.Buttons.Add (toolBarButton);

			//we rather create 2, to expose a bug in the provider
			toolBar.Buttons.Add (new ToolBarButton ("another one"));
			
			Form.Controls.Add (toolBar);
			Form.Show ();
		}
开发者ID:mono,项目名称:uia2atk,代码行数:15,代码来源:ToolBarButtonProviderTest.cs


示例17: Install

		public void Install(IWorkspace workspace)
		{
			MenuItem item = new MenuItem("View");
			workspace.MainMenu.MenuItems.Add(item);

			ToolBar toolbar = workspace.MainToolBar;

			projExAction.Install(workspace, item, toolbar);
			avalItemsAction.Install(workspace, item, toolbar);

			ToolBarButton sep = new ToolBarButton();
			sep.Style = ToolBarButtonStyle.Separator;
			
			toolbar.Buttons.Add( sep );
		}
开发者ID:atczyc,项目名称:castle,代码行数:15,代码来源:ViewActionSet.cs


示例18: CtorTest2

		public void CtorTest2 ()
		{
			ToolBarButton tbb = new ToolBarButton ("hi there");
			Assert.IsNull (tbb.DropDownMenu, "A3");
			Assert.IsTrue (tbb.Enabled, "A4");
			Assert.AreEqual (-1, tbb.ImageIndex, "A5");
			Assert.IsFalse (tbb.PartialPush, "A6");
			Assert.IsFalse (tbb.Pushed, "A7");
			Assert.AreEqual (Rectangle.Empty, tbb.Rectangle, "A8");
			Assert.AreEqual (ToolBarButtonStyle.PushButton, tbb.Style, "A8");
			Assert.IsNull (tbb.Tag, "A9");
			Assert.AreEqual ("hi there", tbb.Text, "A10");
			Assert.AreEqual ("", tbb.ToolTipText, "A11");
			Assert.IsTrue (tbb.Visible, "A12");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:ToolBarButtonTest.cs


示例19: InitializeSketching

        public void InitializeSketching()
        {
            Image image;
            ToolBarButton tbBtnShape;
            Type shapeType;
            XmlObjectDesignTimeBehaviorAttribute xmlObjectDesignTimeBehaviorAttribute;

            tbBtnShape = new ToolBarButton();
            tbBtnShape.ToolTipText = "Arrow";
            tbBtnShape.Tag = null;
            tbBtnShape.ImageIndex =
                this.ilMain.Images.Add(Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("TextMetal.Common.WinForms.DesignTime.Shapes.Resources.SketchArrow.bmp")), Color.Magenta);
            tbBtnShape.Pushed = true;

            this.tbarTools.Buttons.Add(tbBtnShape);

            foreach (string shapeKey in SketchFactory.ShapeKeys)
            {
                tbBtnShape = new ToolBarButton();

                shapeType = SketchFactory.GetShapeType(shapeKey);

                if ((object)shapeType == null)
                    throw new InvalidOperationException();

                xmlObjectDesignTimeBehaviorAttribute = ReflectionFascade.Instance.GetOneAttribute<XmlObjectDesignTimeBehaviorAttribute>(shapeType);

                if ((object)xmlObjectDesignTimeBehaviorAttribute == null)
                    continue;

                if (!xmlObjectDesignTimeBehaviorAttribute.ShowInToolbox)
                    continue;

                tbBtnShape.ToolTipText = xmlObjectDesignTimeBehaviorAttribute.Description;
                tbBtnShape.Tag = shapeKey;

                image = xmlObjectDesignTimeBehaviorAttribute.GetToolboxImage();

                if ((object)image != null)
                    tbBtnShape.ImageIndex = this.ilMain.Images.Add(image, Color.Magenta);
                else
                    tbBtnShape.ImageIndex = 4;

                this.tbarTools.Buttons.Add(tbBtnShape);
            }

            this.SetSketch(null);
        }
开发者ID:alistairwalsh,项目名称:main,代码行数:48,代码来源:SketchDesigner.cs


示例20: Install

		public override void Install(IWorkspace workspace, object parentMenu, object parentGroup)
		{
			base.Install(workspace, parentMenu, parentGroup);

			_item = new MenuItem("&Available Nodes");

			_item.Click += new EventHandler(OnNew);
			(parentMenu as MenuItem).MenuItems.Add(_item);

			_button = new ToolBarButton();
			_button.ToolTipText = "Available Nodes";
			_button.ImageIndex = 5;

			(parentGroup as ToolBar).Buttons.Add( _button );
			(parentGroup as ToolBar).ButtonClick += new ToolBarButtonClickEventHandler(ProjectNewAction_ButtonClick);
		}
开发者ID:ralescano,项目名称:castle,代码行数:16,代码来源:ViewAvailableItemsAction.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ToolBarButtonClickEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.ToolBar类代码示例发布时间: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