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

C# Forms.ToolStripDropDown类代码示例

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

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



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

示例1: FwPopup

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="FwPopup"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public FwPopup()
		{
			InitializeComponent();
			base.DoubleBuffered = true;

			if (DesignMode)
				return;

			base.Dock = DockStyle.Fill;

			m_host = new ToolStripControlHost(this);
			m_host.Padding = Padding.Empty;
			m_host.Margin = Padding.Empty;
			m_host.AutoSize = false;
			m_host.Size = Size;
			m_host.Dock = DockStyle.Fill;

			m_owningDropDown = new ToolStripDropDown();
			m_owningDropDown.Padding = Padding.Empty;
			m_owningDropDown.AutoSize = false;
			m_owningDropDown.LayoutStyle = ToolStripLayoutStyle.Table;
			m_owningDropDown.Size = Size;
			m_owningDropDown.Items.Add(m_host);
			m_owningDropDown.VisibleChanged += m_owningDropDown_VisibleChanged;
			m_owningDropDown.Opened += m_owningDropDown_Opened;
			m_owningDropDown.Closed += m_owningDropDown_Closed;
			m_owningDropDown.Opening += m_owningDropDown_Opening;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:33,代码来源:FwPopup.cs


示例2: UndoButton

        public UndoButton()
        {
            // Initialize the custom control
            m_dropControl = new UndoDropDownControl()
                                {
                                    MinimumSize = new Size(SetWidth, SetHeight) // <- important
                                };
            m_dropControl.ItemChosen += m_dropControl_ItemChosen;

            // ...hosted by a ToolStripControlHost
            m_toolHost = new ToolStripControlHost(m_dropControl)
                         	{
                         		Size = new Size(SetWidth, SetHeight),
                         		Margin = new Padding(0)
                         	};

            // ... and shown in a ToolStripDropDown.
            m_toolDrop = new ToolStripDropDown()
                         	{
                         		Padding = new Padding(0)
                         	};
            m_toolDrop.Items.Add(m_toolHost);

            this.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.BackgroundImageLayout = ImageLayout.Stretch;

            // There is no OnDropDownOpening to override, so I guess we have to do it this way.
            this.DropDownOpening += UndoButton_DropDownOpening;
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:29,代码来源:UndoButton.cs


示例3: AddControl

        public void AddControl( IComboBoxExtender child )
        {
            try {
            childControl = child;
            childControl.SetUserInterface ( );
            treeViewHost = new ToolStripControlHost ( childControl as Control );
            treeViewHost.Visible = false;
            CloseComboBoxExtenderHandler closeCombo = new CloseComboBoxExtenderHandler ( CloseComboBox );
            childControl.CloseComboBoxExtenderDelegate = closeCombo;

            dropDown = new ToolStripDropDown ( );
            dropDown.Items.Add ( treeViewHost );
            dropDown.AutoClose = true;

            this.DropDownStyle = ComboBoxStyle.DropDownList;

            dropDown.Closed += new ToolStripDropDownClosedEventHandler ( DropDownClosed );
            this.EnabledChanged += new EventHandler ( ExtenderCombo_EnabledChanged );

            closeCombo ( );

              } catch ( Exception ex ) {
            MessageBox.Show ( ex.Message );
              }
        }
开发者ID:camalot,项目名称:droidexplorer,代码行数:25,代码来源:ComboBoxEx.cs


示例4: ApplySkin

 public static void ApplySkin(ToolStripDropDown dropDown)
 {
     dropDown.Renderer = new MenuRenderer();
     var size = MeasureDropDown(dropDown);
     dropDown.Width = size.Width;
     dropDown.Height = size.Height + 5;
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:7,代码来源:MenuRenderer.cs


示例5: LayerManagerPanel

        public LayerManagerPanel()
        {
            InitializeComponent();

            // Create other command
            var control = new LayerControl();
            control.ControlsClicked += LayerCommand_ControlsClicked;
            // Add to dropdown list
            var dropdown = new ToolStripDropDown();
            dropdown.Items.Add(new ToolStripControlHost(control));
            btnLayer.DropDown = dropdown;

            // Add sign
            btnAdd.Tag = LayerCommand.Add;

            // Set border width
            _borderWidth = 4F;

            // Set serveral option for paint
            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint, true);
        }
开发者ID:panoti,项目名称:DADHMT_LTW,代码行数:25,代码来源:LayerManagerPanel.cs


示例6: AddContributions_Helper

 /// <summary>
 /// Used by AddContributions to add new ContextMenu Items to a Menu they are about to Display
 /// </summary>
 /// <param name="strip">The form's menu</param>
 /// <param name="itemsIn">New Items to Add</param>
 public static void AddContributions_Helper(ToolStripDropDown strip, List<ToolStripMenuItem> itemsIn)
 {
     if (itemsIn == null || itemsIn.Count == 0) return;
     List<ToolStripItem> items = new List<ToolStripItem>();
     itemsIn.ForEach(o =>
                         {
                             string txt = (o.Text ?? "").ToLower().Trim();
                             foreach (var i in strip.Items)
                             {
                                 ToolStripItem item = (ToolStripItem)i;
                                 if (txt != (item.Text ?? "").ToLower().Trim()) continue;
                                 txt = null;
                                 break;
                             }
                             foreach (var item in items)
                             {
                                 if (txt != (item.Text ?? "").ToLower().Trim()) continue;
                                 txt = null;
                                 break;
                             }
                             if (txt != null) items.Add(o);
                         });
     if (items.Count == 0) return;
     if (strip.Items.Count > 0)
         items.Insert(0, new ToolStripSeparator());
     strip.Items.AddRange(items.ToArray());
     strip.Closing += ((sender, args) => items.ForEach((o) => strip.Items.Remove(o)));
 }
开发者ID:niel,项目名称:radegast,代码行数:33,代码来源:ContextActionsManager.cs


示例7: LineSetPanel

 public LineSetPanel()
 {
     InitializeComponent();
     MouseWheel += LineSetPanel_MouseWheel;
     _popup = new ToolStripDropDown();
     _selectedLines = new List<Line>();
     UseProjection = true;
 }
开发者ID:PeteFohl,项目名称:SDTS-Browser,代码行数:8,代码来源:LineSetPanel.cs


示例8: NewPopup

		public static ToolStripDropDown NewPopup(Control contents)
		{
			var strip = new ToolStripDropDown();
			var host = new ToolStripControlHost(contents);
			strip.Items.Add(host);
			host.Margin = new Padding(0);
			return strip;
		}
开发者ID:Shaykh,项目名称:Loyc,代码行数:8,代码来源:MainForm.cs


示例9: AppendMenuItems

        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            // Place a call to the base class to ensure the default parameter menu is still there and operational.
            base.AppendAdditionalComponentMenuItems(menu);

            // Now insert your own custom menu items.
            //Menu_AppendSeparator(menu);
            Menu_AppendTextItem(menu, this.ComponentName, Menu_ParentLayerNameKeyDown, Menu_ParentLayerNameChanged, true);
            //Menu_AppendItem(menu, "Run Lemmings!", Menu_RunLemmingsClicked);
            return true;
        }
开发者ID:ksteinfe,项目名称:lemmings,代码行数:11,代码来源:Nameable.cs


示例10: AppendMenuItems

        public override bool AppendMenuItems(ToolStripDropDown iMenu)
        {
            var toReturn = base.AppendMenuItems(iMenu);

              {
            var tsi = GetTargetVariableMenuItem();
            iMenu.Items.Insert(Math.Min(iMenu.Items.Count, 1), tsi);
              }

              return toReturn;
        }
开发者ID:rivermao,项目名称:ghpython,代码行数:11,代码来源:PythonComponent.cs


示例11: CommandMenuBuilder

 public CommandMenuBuilder()
 {
     menu = new ContextMenuStrip();
     menu.ShowCheckMargin = false;
     menu.ShowImageMargin = false;
     menu.SuspendLayout();
     menu.Opening +=new System.ComponentModel.CancelEventHandler(menu_Opening);
     menu.Closed += new ToolStripDropDownClosedEventHandler(menu_Closed);
     currentMenu = menu;
     currentButtonBar = new List<ToolStripButton>();
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:11,代码来源:CommandMenuBuilder.cs


示例12: Layout

		public void Layout ()
		{
			ToolStripDropDown drop_down = new ToolStripDropDown ();
			drop_down.Items.Add (new ToolStripVariableSizeItem ());
			drop_down.PerformLayout ();

			// We want to be sure the DropDown is using the size provided
			// by GetPreferredSize, not DefaultSize, and since the extra padding/margin
			// can change by some few pixels, we do a light check
			Assert.AreEqual (true, drop_down.Size.Width >= 100, "A1");
			Assert.AreEqual (true, drop_down.Size.Height >= 100, "A2");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:ToolStripDropDownTest.cs


示例13: CheckComboBox

 public CheckComboBox()
     : base()
 {
     m_checkListBox = new CheckListBox();
     m_checkListBox.Dock = DockStyle.Fill;            
     m_checkListBox.ItemChecked += new ItemCheckedEventHandler(m_checkListBox_ItemChecked);
     m_dropDown = new ToolStripDropDown();
     m_dropDown.Margin = new Padding(0);
     m_dropDown.Padding = new Padding(1);
     m_dropDown.Items.Add(new ToolStripControlHost(m_checkListBox));
     m_dropDown.Closing += new ToolStripDropDownClosingEventHandler(m_dropDown_Closing);            
 }
开发者ID:schultzisaiah,项目名称:just-gestures,代码行数:12,代码来源:CheckComboBox.cs


示例14: AppendMenuItems

        // Overrides the default menu of grasshopper (useful)
        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            Menu_AppendItem(menu, "First item");
            Menu_AppendItem(menu, "Second item");
            Menu_AppendItem(menu, "Third item");
            Menu_AppendSeparator(menu);
            Menu_AppendItem(menu, "Fourth item");
            Menu_AppendItem(menu, "Fifth item");
            Menu_AppendItem(menu, "Sixth item");

            // Return true, otherwise the menu won't be shown.
            return true;
        }
开发者ID:whztt07,项目名称:ifc-visualiser,代码行数:14,代码来源:IfcPreview.cs


示例15: AppendMenuItems

        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            // Place a call to the base class to ensure the default parameter menu is still there and operational.
            //base.AppendAdditionalComponentMenuItems(menu);

            // Now insert your own custom menu items.
            //Menu_AppendItem(menu, "1 Parameter", Menu_ChangeParamCount, true, true);
            //Menu_AppendItem(menu, "2 Parameters", Menu_ChangeParamCount, true, false);
            //Menu_AppendItem(menu, "3 Parameters", Menu_ChangeParamCount, true, false);
            //Menu_AppendSeparator(menu);
            Menu_AppendItem(menu, "Run Lemmings!", Menu_RunLemmingsClicked);
            return true;
        }
开发者ID:ksteinfe,项目名称:lemmings,代码行数:13,代码来源:LemmingsComponent.cs


示例16: ComboBox_TreeView

        public ComboBox_TreeView()
        {
            // new empty tree view
            treeView = new TreeView();
            treeView.BorderStyle = BorderStyle.None;
            treeViewHost = new ToolStripControlHost(treeView);

            // create drop down and add it
            dropDown = new ToolStripDropDown();
            dropDown.Items.Add(treeViewHost);

            // adding signal for action after selection
            treeView.AfterSelect += new TreeViewEventHandler(treeView_AfterSelect);
        }
开发者ID:mistix,项目名称:task-remainder,代码行数:14,代码来源:ComboBox-TreeView.cs


示例17: AppendMenuItems

        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            //base.AppendMenuItems(menu);
            Menu_AppendEnableItem(menu);
            Menu_AppendWarningsAndErrors(menu);
            Menu_AppendObjectHelp(menu);
            Menu_AppendSeparator(menu);

            if (FilepathValid()) { Menu_AppendItem(menu, this.filepath, Menu_FilepathClicked); }
            if (FilepathValid()) { Menu_AppendItem(menu, "Refresh Filepath", Menu_RefreshFilepathClicked); }
            Menu_AppendItem(menu, "Set Filepath", Menu_SetFilepathClicked);

            return true;
        }
开发者ID:ksteinfe,项目名称:dyear,代码行数:14,代码来源:ParseEPLComponent.cs


示例18: StripMenu_Load

		private void StripMenu_Load(object sender, EventArgs e)
		{
					
			// Create the font collection.
			InstalledFontCollection fontFamilies = new InstalledFontCollection();

			// Iterate through all font families.
			foreach (FontFamily family in fontFamilies.Families)
			{
				try
				{
					// Create a ToolStripMenuItem that will display text in this font.
					ToolStripMenuItem item = new ToolStripMenuItem(family.Name);
					item.Font = new Font(family, 8);

					mnuFont.DropDownItems.Add(item);
				}
				catch
				{
					// An error will occur if the selected font does
					// not support normal style (the default used when
					// creating a Font object). This problem can be
					// harmlessly ignored.
				}

			}

			// Code for the table-like File menu:
			
            // Create a new drop-down menu.
			ToolStripDropDown menu = new ToolStripDropDown();

            // Copy the existing items.
            ToolStripItem[] items = new ToolStripItem[fileToolStripMenuItem.DropDown.Items.Count];
            fileToolStripMenuItem.DropDown.Items.CopyTo(items, 0);

            // Transfer the items into the drop-down menu.
			foreach (ToolStripItem item in items)
			{
				if (!(item is ToolStripSeparator)) menu.Items.Add(item);
			}

            // Adjust the layout of the new menu.
			menu.LayoutStyle = ToolStripLayoutStyle.Table;
			((TableLayoutSettings)menu.LayoutSettings).ColumnCount = 2;
            			
            // Attach it to the File menu.
            fileToolStripMenuItem.DropDown = menu;
		}
开发者ID:ehershey,项目名称:development,代码行数:49,代码来源:StripMenu.cs


示例19: DataGridViewColumnSelector

        // The constructor creates an instance of CheckedListBox and ToolStripDropDown.
        // the CheckedListBox is hosted by ToolStripControlHost, which in turn is
        // added to ToolStripDropDown.
        public DataGridViewColumnSelector()
        {
            mCheckedListBox = new CheckedListBox();
            mCheckedListBox.CheckOnClick = true;
            mCheckedListBox.ItemCheck += new ItemCheckEventHandler(mCheckedListBox_ItemCheck);

            ToolStripControlHost mControlHost = new ToolStripControlHost(mCheckedListBox);
            mControlHost.Padding = Padding.Empty;
            mControlHost.Margin = Padding.Empty;
            mControlHost.AutoSize = false;

            mPopup = new ToolStripDropDown();
            mPopup.Padding = Padding.Empty;
            mPopup.Items.Add(mControlHost);
        }
开发者ID:jhanna60,项目名称:WindowsFormFantasyFootball,代码行数:18,代码来源:DataGridViewColumnSelector.cs


示例20: ToolStripFillButton

        public ToolStripFillButton()
        {
            FillColor = Color.Transparent;
            base.Image = GenerateThumbWidthColor(FillColor);

            // Create size and color picker
            _control = new ColorToolControl(FillColor, 0, DashStyle.Solid, true);
            _control.ColorSelected += control_ColorSelected;

            // Add to dropdown list
            var dropdown = new ToolStripDropDown();
            dropdown.Items.Add(new ToolStripControlHost(_control));

            DropDown = dropdown;
        }
开发者ID:panoti,项目名称:DADHMT_LTW,代码行数:15,代码来源:ToolStripFillButton.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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