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


C# ToolStripItem.Select方法代码示例

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


在下文中一共展示了ToolStripItem.Select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeSelection

 internal virtual void ChangeSelection(ToolStripItem nextItem)
 {
     if (nextItem != null)
     {
         ToolStripControlHost host = nextItem as ToolStripControlHost;
         if (base.ContainsFocus && !this.Focused)
         {
             this.FocusInternal();
             if (host == null)
             {
                 this.KeyboardActive = true;
             }
         }
         if (host != null)
         {
             if (this.hwndThatLostFocus == IntPtr.Zero)
             {
                 this.SnapFocus(System.Windows.Forms.UnsafeNativeMethods.GetFocus());
             }
             host.Control.Select();
             host.Control.FocusInternal();
         }
         nextItem.Select();
         ToolStripMenuItem item = nextItem as ToolStripMenuItem;
         if ((item != null) && !this.IsDropDown)
         {
             item.HandleAutoExpansion();
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:ToolStrip.cs

示例2: ChangeSelection

		internal void ChangeSelection (ToolStripItem nextItem)
		{
			if (Application.KeyboardCapture != this)
				ToolStripManager.SetActiveToolStrip (this, ToolStripManager.ActivatedByKeyboard);
				
			foreach (ToolStripItem tsi in this.Items)
				if (tsi != nextItem)
					tsi.Dismiss (ToolStripDropDownCloseReason.Keyboard);

			ToolStripItem current = GetCurrentlySelectedItem ();

			if (current != null && !(current is ToolStripControlHost))
				this.FocusInternal (true);

			if (nextItem is ToolStripControlHost)
				(nextItem as ToolStripControlHost).Focus ();

			nextItem.Select ();
			
			if (nextItem.Parent is MenuStrip && (nextItem.Parent as MenuStrip).MenuDroppedDown)
				(nextItem as ToolStripMenuItem).HandleAutoExpansion ();
		}
开发者ID:nekresh,项目名称:mono,代码行数:22,代码来源:ToolStrip.cs

示例3: ProcessDuplicateMnemonic

 internal virtual void ProcessDuplicateMnemonic(ToolStripItem item, char charCode)
 {
     if (this.CanProcessMnemonic() && (item != null))
     {
         this.SetFocusUnsafe();
         item.Select();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ToolStrip.cs

示例4: AssignContainerToContextMenuStrip_RecursivelyAssign

        /// <summary>
        /// Assign ExpressionMemberContainer to each of Context Menu Strip's items that are child to specified item. 
        /// Item with value equal to current also gets selected.
        /// Called from AssignContainerToContextMenuStrip and recursively calls itself.
        /// </summary>
        /// <param name="item">Current item.</param>
        /// <param name="container">Container to be asigned.</param>
        /// <param name="currentValue">Item with this value will be selected.</param>
        private static void AssignContainerToContextMenuStrip_RecursivelyAssign(ToolStripItem item, ExpressionMemberContainer container, string currentValue)
        {
            if (!(item is ToolStripMenuItem))
                return;

            bool itemSelected = false;
            foreach (ToolStripItem innerItem in ((ToolStripMenuItem)item).DropDownItems)
            {
                AssignContainerToContextMenuStrip_RecursivelyAssign(innerItem, container, currentValue);
                itemSelected = itemSelected || item.Selected;
            }

            item.Tag = container;
            if (container.Member.ValueDescription.AreEqual(container.Member.ValueToXml(item.Text), currentValue))
                item.Select();
        }
开发者ID:Tapsmax,项目名称:ArtemisMissionEditor,代码行数:24,代码来源:ExpressionMemberValueEditor[Static].cs


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