當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。