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


C# Forms.ToolStripDropDown类代码示例

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


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


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