25 types derived from ToolStripItem
System.Windows.Forms (5)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (1)
11public partial class ToolStripButton : ToolStripItem
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
14public partial class ToolStripControlHost : ToolStripItem
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
17public abstract class ToolStripDropDownItem : ToolStripItem
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (1)
14public partial class ToolStripLabel : ToolStripItem
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
11public partial class ToolStripSeparator : ToolStripItem
System.Windows.Forms.Tests (20)
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
342private class SubToolStripItem : ToolStripItem
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (3)
1905private class SubToolStripItem : ToolStripItem 1910private class ToolStripItemWithoutName : ToolStripItem 1914private class ToolStripItemWithNonStringName : ToolStripItem
System\Windows\Forms\StatusStripTests.cs (1)
1251private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripDropDownItemTests.cs (1)
487private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripDropDownTests.cs (1)
5062private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripItemTests.cs (10)
301private class CustomCreateAccessibilityInstanceToolStripItem : ToolStripItem 1094private class CustomDefaultAutoToolTipToolStripItem : ToolStripItem 2106private class CustomDefaultDisplayStyleToolStripItem : ToolStripItem 5892private class CustomDefaultMarginToolStripItem : ToolStripItem 6713private class CustomDefaultPaddingToolStripItem : ToolStripItem 7820private class CustomDefaultSizeToolStripItem : ToolStripItem 15282private class NullTextToolStripItem : ToolStripItem 15449private class FlippingEnabledToolStripItem : ToolStripItem 15473private class CannotSelectToolStripItem : ToolStripItem 15483private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripRendererTests.cs (1)
1017private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripSplitButtonTests.cs (1)
436private class SubToolStripItem : ToolStripItem
System\Windows\Forms\ToolStripTests.cs (1)
7479private class SubToolStripItem : ToolStripItem
912 references to ToolStripItem
Accessibility_Core_App (27)
DataControls.Designer.cs (1)
77this.bindingNavigator1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
Menu_Toolbars_controls.Designer.cs (13)
110menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, editToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem, toolStripMenuItem1, toolStripComboBox1, toolStripTextBox1 }); 123contextMenuStrip1.Items.AddRange(new ToolStripItem[] { menuStripToolStripMenuItem, shortCutsToolStripMenuItem }); 130menuStripToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { item1ToolStripMenuItem }); 143shortCutsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { item2ToolStripMenuItem }); 156fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, toolStripSeparator, saveToolStripMenuItem, saveAsToolStripMenuItem, toolStripSeparator1, printToolStripMenuItem, printPreviewToolStripMenuItem, toolStripSeparator2, exitToolStripMenuItem }); 235editToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { undoToolStripMenuItem, redoToolStripMenuItem, toolStripSeparator3, cutToolStripMenuItem, copyToolStripMenuItem, pasteToolStripMenuItem, toolStripSeparator4, selectAllToolStripMenuItem }); 300toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { customizeToolStripMenuItem, optionsToolStripMenuItem }); 320helpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { contentsToolStripMenuItem, indexToolStripMenuItem, searchToolStripMenuItem, toolStripSeparator5, aboutToolStripMenuItem }); 357toolStripMenuItem1.DropDownItems.AddRange(new ToolStripItem[] { uncheckedCheckOnClickToolStripMenuItem, checkCheckOnClickToolStripMenuItem, checkedCheckOnClickFToolStripMenuItem, indeterminateToolStripMenuItem, indeterminateCheckOnClickFToolStripMenuItem }); 421statusStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, toolStripSplitButton1, toolStripStatusLabel1, toolStripProgressBar1 }); 434toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { toolStripSeparator9, toolStripTextBox3, toolStripMenuItem3 }); 460toolStripSplitButton1.DropDownItems.AddRange(new ToolStripItem[] { toolStripTextBox2, toolStripSeparator8, toolStripComboBox2, toolStripMenuItem2 }); 504toolStrip1.Items.AddRange(new ToolStripItem[] { newToolStripButton, toolStripSeparator7, toolStripButton1, toolStripButton2, toolStripButton3, toolStripButton4, toolStripButton5, toolStripButton6 });
PrintingControls.cs (1)
62foreach (ToolStripItem item in ((ToolStrip)printPreviewDialog1.Controls[1]).Items)
RemainingControls.cs (2)
13foreach (ToolStripItem item in ((ToolStrip)propertyGrid1.Controls[3]).Items) 23foreach (ToolStripItem item in ((ToolStrip)propertyGrid2.Controls[3]).Items)
ToolStripContainer.Designer.cs (10)
122this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 162this.toolStripSplitButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 274this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 291this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 332this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 348this.menuStripToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 364this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 449this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 517this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 539this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
DesignSurface (4)
MainForm.Designer.cs (4)
163this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 176this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 264this.toolStripMenuItemTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 279this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
System.Windows.Forms (275)
System\Windows\Forms\Accessibility\AccessibleRoles.cs (1)
11/// <see cref="ToolStripItem.AccessibleRole"/> to ensure the new member is valid.
System\Windows\Forms\ContextMenuStrip.cs (1)
66ToolStripItem item = Items[i];
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
12/// <see cref="ButtonBase"/>, parts of <see cref="ToolStripItem"/>, and parts of <see cref="DataGridView"/>.
System\Windows\Forms\Controls\Menus\MenuStrip.cs (5)
142protected internal override ToolStripItem CreateDefaultItem(string? text, Image? image, EventHandler? onClick) 154internal override ToolStripItem? GetNextItem(ToolStripItem? start, ArrowDirection direction, bool rtlAware) 156ToolStripItem? nextItem = base.GetNextItem(start, direction, rtlAware); 256ToolStripItem? item = GetItemAt(pt);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
3857List<ToolStripItem> buttonList = fullRebuild ? new() : new(_toolStrip.Items.OfType<ToolStripItem>());
System\Windows\Forms\Controls\ToolStrips\MergeHistoryItem.cs (1)
15public ToolStripItem? TargetItem { get; set; }
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (5)
247protected internal override ToolStripItem CreateDefaultItem(string? text, Image? image, EventHandler? onClick) 336ToolStripItem? item = levent.AffectedComponent as ToolStripItem; 380ToolStripItem? lastItem = null; 383ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (68)
37private ToolStripItem? _lastMouseActiveItem; 38private ToolStripItem? _lastMouseDownedItem; 47private ToolStripItem? _currentlyActiveTooltipItem; 156public ToolStrip(params ToolStripItem[] items) 873foreach (ToolStripItem item in Items) 934foreach (ToolStripItem item in Items) 975foreach (ToolStripItem item in Items) 1149internal ToolStripItem? LastMouseDownedItem 1624foreach (ToolStripItem item in Items) 1727internal virtual void ChangeSelection(ToolStripItem? nextItem) 1776protected internal virtual ToolStripItem CreateDefaultItem(string? text, Image? image, EventHandler? onClick) => 1781private void ClearAllSelectionsExcept(ToolStripItem? item) 1787ToolStripItem[] displayedItems = new ToolStripItem[DisplayedItems.Count]; 1864ToolStripItem? lastItem = _lastMouseDownedItem; 2024internal virtual ToolStripItem? GetNextItem(ToolStripItem? start, ArrowDirection direction, bool rtlAware) 2047public virtual ToolStripItem? GetNextItem(ToolStripItem? start, ArrowDirection direction) 2068private ToolStripItem? GetNextItemHorizontal(ToolStripItem? start, bool forward) 2121private ToolStripItem? GetNextItemVertical(ToolStripItem? selectedItem, bool down) 2123ToolStripItem? tanWinner = null; 2124ToolStripItem? hypotenuseWinner = null; 2145ToolStripItem otherItem = DisplayedItems[i]; 2281ToolStripItem item = toolStrip.Items[j]; 2340ToolStripItem item = toolStrip.Items[j]; 2394private static Size GetPreferredItemSize(ToolStripItem item) 2400internal ToolStripItem? GetSelectedItem() 2402ToolStripItem? selectedItem = null; 2460internal void HandleItemClick(ToolStripItem dismissingItem) 2472internal virtual void HandleItemClicked(ToolStripItem dismissingItem) 2577internal void InvokePaintItem(ToolStripItem item) 2690ToolStripItem? selectedItem = GetSelectedItem(); 2699foreach (ToolStripItem item in Items) 2745ToolStripItem? item = GetSelectedItem(); 2808internal virtual void ProcessDuplicateMnemonic(ToolStripItem item, char charCode) 2874ToolStripItem? startingItem = GetSelectedItem(); 2883ToolStripItem? firstMatch = null; 2890ToolStripItem currentItem = DisplayedItems[index]; 2953ToolStripItem currentItem = DisplayedItems[index]; 3053ToolStripItem? currentSel = GetSelectedItem(); 3056ToolStripItem? nextItem = GetNextItem(currentSel, ArrowDirection.Down); 3065ToolStripItem? nextItem = GetNextItem(currentSel, ArrowDirection.Up); 3090internal void NotifySelectionChange(ToolStripItem? item) 3314ToolStripItem? item = GetItemAt(mea.X, mea.Y); 3348ToolStripItem? item = GetItemAt(mea.X, mea.Y); 3423ToolStripItem? item = Grip.MovingToolStrip ? Grip : GetItemAt(mea.X, mea.Y); 3501ToolStripItem item = DisplayedItems[i]; 3744foreach (ToolStripItem item in Items) 3864public ToolStripItem? GetItemAt(int x, int y) => GetItemAt(new Point(x, y)); 3870public ToolStripItem? GetItemAt(Point point) 3936ToolStripItem[] itemsArray = items.Cast<ToolStripItem>().ToArray(); 3937foreach (ToolStripItem toolStripItem in itemsArray) 4047foreach (ToolStripItem item in Items) 4060protected internal void SetItemLocation(ToolStripItem item, Point location) 4075protected static void SetItemParent(ToolStripItem item, ToolStrip parent) 4148internal ToolStripItem? SelectNextToolStripItem(ToolStripItem? start, bool forward) 4150ToolStripItem? nextItem = GetNextItem(start, forward ? ArrowDirection.Right : ArrowDirection.Left, rtlAware: true); 4270ToolStripItem item = Items[j]; 4336ToolStripItem item = Items[j]; 4489internal void UpdateToolTip(ToolStripItem? item, bool refresh = false) 4675internal void OnItemAddedInternal(ToolStripItem item) 4683internal void OnItemRemovedInternal(ToolStripItem item, ToolStripItemCollection itemCollection) 4708ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (9)
30ToolStripItem? item = owner.GetItemAt(clientHit); 58ToolStripItem? item = null; 170ToolStripItem item = items[fragmentIndex]; 179AccessibleObject? GetItemAccessibleObject(ToolStripItem item) 217ToolStripItem item = items[i]; 237ToolStripItem item = items[i]; 278internal int GetChildFragmentIndex(ToolStripItem.ToolStripItemAccessibleObject child) 313ToolStripItem item = items[index]; 323internal int GetChildIndex(ToolStripItem.ToolStripItemAccessibleObject child)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObjectWrapperForItemsOnOverflow.cs (2)
8private class ToolStripAccessibleObjectWrapperForItemsOnOverflow : ToolStripItem.ToolStripItemAccessibleObject 10public ToolStripAccessibleObjectWrapperForItemsOnOverflow(ToolStripItem item)
System\Windows\Forms\Controls\ToolStrips\ToolStripArrowRenderEventArgs.cs (2)
15ToolStripItem? toolStripItem, 45public ToolStripItem? Item { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (10)
14private ToolStripItem? _ownerItem; 51internal ToolStripDropDown(ToolStripItem ownerItem) : this() => _ownerItem = ownerItem; 53internal ToolStripDropDown(ToolStripItem ownerItem, bool isAutoGenerated) : this(ownerItem) => _isAutoGenerated = isAutoGenerated; 603public ToolStripItem? OwnerItem 1063internal ToolStripItem? GetToplevelOwnerItem() 1069internal override void HandleItemClicked(ToolStripItem dismissingItem) 1244ToolStripItem? itemOnPreviousMenuToSelect = OwnerItem; 1313ToolStripItem? rootItem = GetToplevelOwnerItem(); 1394internal override void ProcessDuplicateMnemonic(ToolStripItem item, char charCode) 1697ToolStripItem? rootOwnerItem = GetToplevelOwnerItem();
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (1)
58public ToolStripDropDownButton(string? text, Image? image, params ToolStripItem[]? dropDownItems)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (3)
45protected ToolStripDropDownItem(string? text, Image? image, params ToolStripItem[]? dropDownItems) 288internal virtual void AutoHide(ToolStripItem otherItemBeingSelected) 781foreach (ToolStripItem childItem in item.DropDown.Items)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItemAccessibleObject.cs (3)
10public class ToolStripDropDownItemAccessibleObject : ToolStripItem.ToolStripItemAccessibleObject 123internal int GetChildFragmentIndex(ToolStripItem.ToolStripItemAccessibleObject child) 197ToolStripItem item = dropDown.DisplayedItems[index];
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (12)
51internal ToolStripDropDownMenu(ToolStripItem ownerItem, bool isAutoGenerated) 216ToolStripItem itemToAdd; 284ToolStripItem item = Items[i]; 462internal override void ChangeSelection(ToolStripItem? nextItem) 512protected internal override ToolStripItem CreateDefaultItem(string? text, Image? image, EventHandler? onClick) 524internal override ToolStripItem? GetNextItem(ToolStripItem? start, ArrowDirection direction, bool rtlAware) 748ToolStripItem itemTop = Items[_indexOfFirstDisplayedItem - 1]; 749ToolStripItem itemBottom = Items[_indexOfFirstDisplayedItem]; 761ToolStripItem itemTop = Items[_indexOfFirstDisplayedItem]; 762ToolStripItem itemBottom = Items[_indexOfFirstDisplayedItem + 1]; 818ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (5)
54private ToolStripItem? FindItemAtPoint(int x, int y) 63if (_owner.AllowItemReorder && e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 69ToolStripItem? item = FindItemAtPoint(e.X, e.Y); 104if (_owner.AllowItemReorder && e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 110ToolStripItem? item = FindItemAtPoint(e.X, e.Y);
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (3)
203ToolStripItem item = e.Item; 462private static void DrawHightContrastDashedBorder(Graphics graphics, ToolStripItem item) 490ToolStripItem item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
1425public ToolStripItem? OwnerItem 1788/// <see cref="ToolStripItem" /> changes. Call base.OnSelectedChanged to send this event to any registered 2060ToolStripItem item = this; 2169else if (data is ToolStripItem) 2178iwdata.SetData(typeof(ToolStripItem).ToString(), data); 3502ToolStripItem item = this;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (4)
19private readonly ToolStripItem _ownerItem; // The associated ToolStripItem for this AccessibleChild (if any) 25public ToolStripItemAccessibleObject(ToolStripItem ownerItem) 144internal ToolStripItem Owner => _ownerItem; 231ToolStripItem? nextItem = null;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemImageIndexer.cs (2)
10private readonly ToolStripItem _item; 12public ToolStripItemImageIndexer(ToolStripItem item)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (3)
17private readonly ToolStripItem _ownerItem; 25public ToolStripItemInternalLayout(ToolStripItem ownerItem) 30protected virtual ToolStripItem Owner => _ownerItem;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemClickedEventArgs.cs (2)
11public ToolStripItemClickedEventArgs(ToolStripItem? clickedItem) 19public ToolStripItem? ClickedItem { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (32)
36public ToolStripItemCollection(ToolStrip owner, ToolStripItem[] value) 44public new virtual ToolStripItem this[int index] 48return (ToolStripItem)(InnerList[index]); 55public virtual ToolStripItem? this[string? key] 69return (ToolStripItem)InnerList[index]; 78public ToolStripItem Add(string? text) 83public ToolStripItem Add(Image? image) 88public ToolStripItem Add(string? text, Image? image) 93public ToolStripItem Add(string? text, Image? image, EventHandler? onClick) 95ToolStripItem item = _owner!.CreateDefaultItem(text, image, onClick); 100public int Add(ToolStripItem value) 115public void AddRange(params ToolStripItem[] toolStripItems) 158foreach (ToolStripItem item in itemsToAdd) 165public bool Contains(ToolStripItem value) 217private void CheckCanAddOrInsertItem(ToolStripItem value) 242public ToolStripItem[] Find(string key, bool searchAllChildren) 246List<ToolStripItem> foundItems = []; 255private static void FindInternal(string key, bool searchAllChildren, ToolStripItemCollection itemsToLookIn, List<ToolStripItem> foundItems) 301void IList.Remove(object? value) { Remove((ToolStripItem)value!); } 302int IList.Add(object? value) { return Add((ToolStripItem)value!); } 303int IList.IndexOf(object? value) { return IndexOf((ToolStripItem)value!); } 304void IList.Insert(int index, object? value) { Insert(index, (ToolStripItem)value!); } 312public void Insert(int index, ToolStripItem value) 334public int IndexOf(ToolStripItem value) 385private void OnAfterRemove(ToolStripItem item) 413public void Remove(ToolStripItem value) 435ToolStripItem item = index >= Count || index < 0 437: (ToolStripItem)InnerList[index]; 460public void CopyTo(ToolStripItem[] array, int index) 465internal void MoveItem(ToolStripItem value) 479internal void MoveItem(int index, ToolStripItem value) 506private void SetOwner(ToolStripItem item)
System\Windows\Forms\Controls\ToolStrips\ToolStripItemEventArgs.cs (2)
8public ToolStripItemEventArgs(ToolStripItem? item) 13public ToolStripItem? Item { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripItemImageRenderEventArgs.cs (2)
11public ToolStripItemImageRenderEventArgs(Graphics g, ToolStripItem item, Rectangle imageRectangle) 23ToolStripItem item,
System\Windows\Forms\Controls\ToolStrips\ToolStripItemRenderEventArgs.cs (2)
13public ToolStripItemRenderEventArgs(Graphics g, ToolStripItem item) 27public ToolStripItem Item { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (3)
21ToolStripItem item, 44ToolStripItem item, 58TextFormat = ToolStripItem.ToolStripItemInternalLayout.ContentAlignmentToTextFormat(textAlign, item.RightToLeft == RightToLeft.Yes);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (8)
200foreach (ToolStripItem item in toolStrip.Items) 1031private static ToolStripItem? FindMatch(ToolStripItem source, ToolStripItemCollection destinationItems) 1035ToolStripItem? result = null; 1040ToolStripItem candidateItem = destinationItems[i]; 1120ToolStripItem item = sourceToolStrip.Items[itemToLookAt]; 1145private static void MergeRecursive(ToolStripItem source, ToolStripItemCollection destinationItems, Stack<MergeHistoryItem> history) 1154ToolStripItem? item = FindMatch(source, destinationItems);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (2)
95public ToolStripMenuItem(string? text, Image? image, params ToolStripItem[]? dropDownItems) 162internal override void AutoHide(ToolStripItem otherItemBeingSelected)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (2)
77foreach (ToolStripItem item in displayedItems) 107foreach (ToolStripItem item in displayedItems)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (2)
13public ToolStripOverflow(ToolStripItem parentItem) 137ToolStripItem item = DisplayedItems[j];
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (7)
156ToolStripItem item = e.Item; 544ToolStripItem item = e.Item; 677ToolStripItem? item = e.Item; 904ToolStripItem item = toolStrip.OverflowButton; 1107ToolStripItem item = e.Item; 1452private void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical) 1566ToolStripItem item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (2)
578protected internal virtual void InitializeItem(ToolStripItem item) 864ToolStripItem? item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
219foreach (ToolStripItem item in toolStrip.Items)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (4)
15private ToolStripItem? _defaultItem; 69public ToolStripSplitButton(string? text, Image? image, params ToolStripItem[]? dropDownItems) 143public ToolStripItem? DefaultItem 548/// Determines if the <see cref="ToolStripItem.Size"/> property needs to be persisted.
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonButtonLayout.cs (1)
25protected override ToolStripItem Owner
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (9)
23if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 37if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 39ToolStripItem item = (ToolStripItem)e.Data.GetData(typeof(ToolStripItem))!; 46if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 69private void OnDropItem(ToolStripItem droppedItem, Point ownerClientAreaRelativeDropPoint) 74ToolStripItem item = _owner.Items[toolStripItemIndex]; 136ToolStripItem item = _owner.Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (7)
69ToolStripItem item = toolStrip.Items[ForwardsWalkingIndex]; 119ToolStripItem item = toolStrip.Items[ForwardsWalkingIndex]; 241ToolStripItem? item; 383ToolStripItem? item; 487private void SetItemLocation(ToolStripItem item, Point itemLocation, Size itemSize) 525ToolStripItem item = toolStrip.Items[i]; 570ToolStripItem item = ToolStrip.Items[BackwardsWalkingIndex];
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (6)
84private static int GetItemState(ToolStripItem item) 148private static ToolBarState GetToolBarState(ToolStripItem item) 380ToolStripItem item = e.Item; 645ToolStripItem item = e.Item; 689private static void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical) 790ToolStripItem item = e.Item;
System\Windows\Forms\DataBinding\BindingNavigator.cs (22)
18private ToolStripItem? _moveFirstItem; 19private ToolStripItem? _movePreviousItem; 20private ToolStripItem? _moveNextItem; 21private ToolStripItem? _moveLastItem; 22private ToolStripItem? _addNewItem; 23private ToolStripItem? _deleteItem; 24private ToolStripItem? _positionItem; 25private ToolStripItem? _countItem; 259public ToolStripItem? MoveFirstItem 283public ToolStripItem? MovePreviousItem 307public ToolStripItem? MoveNextItem 331public ToolStripItem? MoveLastItem 355public ToolStripItem? AddNewItem 385public ToolStripItem? DeleteItem 415public ToolStripItem? PositionItem 439public ToolStripItem? CountItem 833private void WireUpButton(ref ToolStripItem? oldButton, ToolStripItem? newButton, EventHandler clickHandler) 858private void WireUpTextBox(ref ToolStripItem? oldTextBox, ToolStripItem? newTextBox, KeyEventHandler keyUpHandler, EventHandler lostFocusHandler) 883private void WireUpLabel(ref ToolStripItem? oldLabel, ToolStripItem? newLabel)
System\Windows\Forms\Input\MouseHoverTimer.cs (6)
9private readonly WeakReference<ToolStripItem?> _currentItem = new(null); 17public void Start(ToolStripItem? item) 19_currentItem.TryGetTarget(out var currentItem); 35public void Cancel(ToolStripItem? item) 37_currentItem.TryGetTarget(out var currentItem); 59if (_currentItem.TryGetTarget(out var currentItem) && !currentItem.IsDisposed)
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
48foreach (ToolStripItem item in Items)
System\Windows\Forms\MDI\MdiWindowListItemConverter.cs (2)
23List<ToolStripItem> list = []; 26if (values[i] is ToolStripItem currentItem && currentItem.Owner == menu)
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
1141if (sender is ToolStripItem item && !item.Selected)
System.Windows.Forms.Design (297)
System\ComponentModel\Design\DesignerActionUI.cs (1)
672else if (relatedComponent is ToolStripItem item)
System\Windows\Forms\Design\BaseContextMenuStrip.cs (3)
106else if (selectionService.PrimarySelection is ToolStripItem selectedItem) 242foreach (ToolStripItem item in Items) 263private static readonly string s_systemWindowsFormsNamespace = typeof(ToolStripItem).Namespace!;
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (4)
95private void SiteItem(IDesignerHost? host, ToolStripItem item) 119foreach (ToolStripItem item in items) 127ToolStripItem? item = e.Component as ToolStripItem;
System\Windows\Forms\Design\CommandSet.cs (1)
2059if ((TypeDescriptor.GetAttributes(curComp).Contains(DesignTimeVisibleAttribute.Yes)) || curComp is ToolStripItem)
System\Windows\Forms\Design\ContextMenuStripGroup.cs (2)
8private List<ToolStripItem>? _items; 10public List<ToolStripItem> Items => _items ??= [];
System\Windows\Forms\Design\CustomMenuItemCollection.cs (2)
23public int Add(ToolStripItem value) 31public void AddRange(params ToolStripItem[] value)
System\Windows\Forms\Design\DesignerUtils.cs (1)
772else if (comp is ToolStripItem item && item.GetCurrentParent() is null)
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (2)
52List<ToolStripItem> items = _groups[groupName].Items; 59foreach (ToolStripItem item in items)
System\Windows\Forms\Design\NewItemsContextMenuStrip.cs (4)
14private readonly ToolStripItem _currentItem; 18ToolStripItem currentItem, 41foreach (ToolStripItem item in ToolStripDesignerUtils.GetStandardItemMenuItems(_component, _onClick, _convertTo)) 53foreach (ToolStripItem item in ToolStripDesignerUtils.GetCustomItemMenuItems(_component, _onClick, _convertTo, _serviceProvider))
System\Windows\Forms\Design\StandardMenuStripVerb.cs (2)
133ToolStripItem item = null; 304ToolStripItem item = null;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (3)
137foreach (ToolStripItem item in group.Items) 167foreach (ToolStripItem item in group.Items) 355menu.Items.AddRange((ToolStripItem[])[add, insert, delete, separator, label, absolute, percent, autosize]);
System\Windows\Forms\Design\TabPageCollectionEditor.cs (1)
10/// Allows a single level of <see cref="ToolStripItem"/> children to be designed.
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (3)
17private readonly ToolStripItem _currentItem; 24_currentItem = currentItem as ToolStripItem; 111parent.Items.Insert(dummyIndex, (ToolStripItem)component);
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (1)
23foreach (ToolStripItem item in toolStrip.Items)
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
279if (component is ToolStripItem item)
System\Windows\Forms\Design\ToolStripDesigner.cs (45)
25internal static ToolStripItem s_dragItem; // this is used in overflow to know current item selected while drag, so that we can get the drop-index. 147foreach (ToolStripItem item in ToolStrip.Items) 466foreach (ToolStripItem item in ToolStrip.Items) 485private void AddItemBodyGlyph(ToolStripItem item) 507private ToolStripItem AddNewItem(Type t) 558return component as ToolStripItem; 562internal ToolStripItem AddNewItem(Type t, string text, bool enterKeyPressed, bool tabKeyPressed) 567ToolStripItem item = null; 594item = component as ToolStripItem; 752if (comp is ToolStripItem item) 784ToolStripItem ownerItem = dropDown.OwnerItem; 786ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.OwnerItem; 797ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).OwnerItem; 801ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.OwnerItem; 838if (KeyboardHandlingService.SelectedDesignerControl is ToolStripItem designerItem && designerItem.IsOnDropDown) 854if (SelectionService.PrimarySelection is ToolStripItem toolItem) 894if (e.Component is ToolStripItem newItem && _addingItem && !newItem.IsOnDropDown) 909if (SelectionService.PrimarySelection is ToolStripItem selectedItem) 975if (selectedItem is ToolStripItem currentSel && currentSel.Owner != ToolStrip) 982ToolStripItem addingItem = e.Component as ToolStripItem; 1009if (e.Component is ToolStripItem changingItem) 1033if (e.Component is ToolStripItem item && item.Owner == Component) 1110if (e.Component is ToolStripItem item && item.Owner == Component) 1239if (selectedItem is ToolStripItem) 1276ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.Count]; 1278foreach (ToolStripItem toolItem in items) 1295foreach (ToolStripItem item in ToolStrip.Items) 1357if (comp is ToolStripItem item && item.Visible) 1611private static bool ItemParentIsOverflow(ToolStripItem item) 1832List<ToolStripItem> dragComponents = data.DragComponents; 1833ToolStripItem primaryItem = data.PrimarySelection; 1885primaryItem = components[primaryIndex] as ToolStripItem; 1900parentToolStrip.Items.Insert(0, components[i] as ToolStripItem); 1904parentToolStrip.Items.Add(components[i] as ToolStripItem); 2003if (SelectionService.PrimarySelection is ToolStripItem curSel && curSel.IsOnOverflow) 2005ToolStripItem nextItem = ToolStrip.GetNextItem(ToolStrip.OverflowButton, ArrowDirection.Left); 2033if (!(SelectionService.PrimarySelection is ToolStripItem curSel) || (curSel is not null && !curSel.IsOnOverflow)) 2035ToolStripItem nextItem = ddi.DropDown.GetNextItem(null, ArrowDirection.Down); 2049foreach (ToolStripItem item in ToolStrip.Items) 2228foreach (ToolStripItem item in ToolStrip.Items) 2388if (SelectionService.PrimarySelection is not ToolStripItem) 2429ToolStripItem newItem = AddNewItem(typeof(ToolStripMenuItem)); 2462foreach (ToolStripItem item in ToolStrip.Items)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (16)
19private static readonly Type s_toolStripItemType = typeof(ToolStripItem); 33private static readonly string s_systemWindowsFormsNamespace = typeof(ToolStripItem).Namespace; 56public static void GetAdjustedBounds(ToolStripItem item, ref Rectangle r) 90if (component is ToolStripItem stripItem) 319public static ToolStripItem[] GetStandardItemMenuItems(IComponent component, EventHandler onClick, bool convertTo) 322ToolStripItem[] items = new ToolStripItem[standardTypes.Length]; 343public static ToolStripItem[] GetCustomItemMenuItems(IComponent component, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider) 346ToolStripItem[] items = new ToolStripItem[customTypes.Length]; 367public static NewItemsContextMenuStrip GetNewItemDropDown(IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider, bool populateCustom) 373foreach (ToolStripItem item in GetStandardItemMenuItems(component, onClick, convertTo)) 404public static void GetCustomNewItemDropDown(NewItemsContextMenuStrip contextMenu, IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider) 406foreach (ToolStripItem item in GetCustomItemMenuItems(component, onClick, convertTo, serviceProvider)) 421public static void InvalidateSelection(ArrayList originalSelComps, ToolStripItem nextSelection, IServiceProvider provider, bool shiftPressed) 446if (comp is ToolStripItem selItem)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (8)
205if (selComp is ToolStripItem item) 452else if (comp is ToolStripItem item) // case (c) 462ToolStripItem ownerItem = parent.OwnerItem; 480ToolStripItem topMostItem = topmost.OwnerItem; 641public void ShowMenu(ToolStripItem selectedItem) 669ToolStripItem[] items = new ToolStripItem[_dropDown.Items.Count]; 671foreach (ToolStripItem toolItem in items)
System\Windows\Forms\Design\ToolStripEditorManager.cs (2)
33private ToolStripItem _currentItem; 47internal void ActivateEditor(ToolStripItem item)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (38)
48private static bool CommonParent(ToolStripItem oldSelection, ToolStripItem newSelection) 58private static void ClearInsertionMark(ToolStripItem item) 111private static ISelectionService GetSelectionService(ToolStripItem item) 125private static BehaviorService GetBehaviorService(ToolStripItem item) 139private static ToolStripKeyboardHandlingService GetKeyBoardHandlingService(ToolStripItem item) 153private static Rectangle GetPaintingBounds(IDesignerHost designerHost, ToolStripItem item) 175private bool MouseHandlerPresent(ToolStripItem item) 221ToolStripItem glyphItem = glyph.Item; 238ToolStripItem selectedItem = selSvc.PrimarySelection as ToolStripItem; 280ToolStripItem glyphItem = glyph.Item; 321if (selSvc.PrimarySelection is ToolStripItem currentSel && currentSel == glyphItem) 335ToolStripItem selectedItem = selSvc.PrimarySelection as ToolStripItem; 477ToolStripItem glyphItem = glyph.Item; 503ToolStripItem glyphItem = glyph.Item; 531ToolStripItem glyphItem = glyph.Item; 563ToolStripItem ownerItem = parentDropDown.OwnerItem; 585List<ToolStripItem> dragItems = []; 591if (comp is ToolStripItem item) 598if (selSvc.PrimarySelection is ToolStripItem selectedItem) 645ToolStripItem currentDropItem = ToolStripDesigner.s_dragItem; 650ToolStripItem selectedItem = data.PrimarySelection; 656List<ToolStripItem> dragComponents = data.DragComponents; 683ToolStripItem ownerItem = dropDown.OwnerItem; 717selectedItem = components[primaryIndex] as ToolStripItem; 750foreach (ToolStripItem item in components) 765ToolStripItem ownerItem = dropDown.OwnerItem; 778ToolStripItem ownerItem = dropDown.OwnerItem; 791foreach (ToolStripItem item in components) 845ToolStripItem glyphItem = glyph.Item; 882ToolStripItem glyphItem = glyph.Item; 897private static void PaintInsertionMark(ToolStripItem item) 953ToolStripItem item = sender as ToolStripItem; 963private void SetParentDesignerValuesForDragDrop(ToolStripItem glyphItem, bool setValues, Point mouseLoc) 1005ToolStripItem ownerItem = parentDropDown.OwnerItem;
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (14)
17private readonly ToolStripItem _currentItem; 51_currentItem = currentItem as ToolStripItem; 117ToolStripItem selectedItem = _currentItem; 160_alignmentToolStripMenuItem.DropDownItems.AddRange((ToolStripItem[])[_leftToolStripMenuItem, _rightToolStripMenuItem]); 163_displayStyleToolStripMenuItem.DropDownItems.AddRange((ToolStripItem[])[_noneStyleToolStripMenuItem, _textStyleToolStripMenuItem, _imageStyleToolStripMenuItem, _imageTextStyleToolStripMenuItem]); 254ToolStripItem item = sender as ToolStripItem; 270ToolStripItem item = sender as ToolStripItem; 397parent.Items.Insert(dummyIndex, (ToolStripItem)component); 449parent.Items.Insert(dummyIndex, (ToolStripItem)component); 488parent.Items.Insert(dummyIndex, (ToolStripItem)component); 545parent.Items.Insert(dummyIndex, (ToolStripItem)component); 637ToolStripItem selectedItem = _currentItem;
System\Windows\Forms\Design\ToolStripItemDataObject.cs (4)
11internal ToolStripItemDataObject(List<ToolStripItem> dragComponents, ToolStripItem primarySelection, ToolStrip owner) : base() 18internal List<ToolStripItem> DragComponents { get; } 22internal ToolStripItem PrimarySelection { get; }
System\Windows\Forms\Design\ToolStripItemDesigner.cs (23)
95foreach (ToolStripItem item in _toolStripItemCustomMenuItemCollection) 224public ToolStripItem ToolStripItem 226get => (ToolStripItem)Component; 261if (startComp is ToolStripItem) 263ToolStripItem item = startComp as ToolStripItem; 275ToolStripItem ownerItem = parentDropDown.OwnerItem; 325ToolStripItem newItem = null; 490foreach (ToolStripItem item in _toolStripItemCustomMenuItemCollection) 537foreach (ToolStripItem item in parent.DropDownItems) 559foreach (ToolStripItem item in parent.DropDownItems) 608internal static ToolStripDropDown GetFirstDropDown(ToolStripItem currentItem) 713internal virtual ToolStripItem MorphCurrentItem(Type t) 715ToolStripItem newItem = null; 735ToolStripItem ownerItem = null; 798ToolStripItem component = (ToolStripItem)host.CreateComponent(t, name); 811newItem = (ToolStripItem)host.Container.Components[name]; 943ToolStripItem currentSelection = sSvc.PrimarySelection as ToolStripItem; 945if (ToolStripItem.AccessibilityObject is ToolStripItem.ToolStripItemAccessibleObject acc) 1127ToolStripItem nextItem = parent.Items[currentIndex + 1]; 1148foreach (ToolStripItem item in parent.DropDownItems)
System\Windows\Forms\Design\ToolStripItemGlyph.cs (2)
14public ToolStripItemGlyph(ToolStripItem item, ToolStripItemDesigner itemDesigner, Rectangle bounds, Behavior.Behavior? b) : base(bounds, Cursors.Default, item, b) 20public ToolStripItem Item { get; }
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (46)
173if (curDesignerNode.AccessibilityObject is ToolStripItem.ToolStripItemAccessibleObject acc) 299private static ToolStripItem GetNextItem(ToolStrip parent, ToolStripItem startItem, ArrowDirection direction) 605ToolStripItem item = comp as ToolStripItem; 673if (selSvc.PrimarySelection is not ToolStripItem item) 675item = SelectedDesignerControl as ToolStripItem; 718if (selSvc.PrimarySelection is not ToolStripItem item) 720item = SelectedDesignerControl as ToolStripItem; 765if (selectedObj is ToolStripItem) 767ToolStripItem selectedItem = selectedObj as ToolStripItem; 922if (comp is ToolStripItem) 994if (selSvc.PrimarySelection is not ToolStripItem item) 996item = SelectedDesignerControl as ToolStripItem; 1048if (selSvc.PrimarySelection is not ToolStripItem item) 1050item = SelectedDesignerControl as ToolStripItem; 1094primarySelection = SelectedDesignerControl as ToolStripItem; 1107if (tool is null && !(primarySelection is ToolStripItem)) 1122primarySelection = SelectedDesignerControl as ToolStripItem; 1135if (tool is not null || primarySelection is ToolStripItem) 1157if (selectionService.PrimarySelection is not ToolStripItem item) 1159item = SelectedDesignerControl as ToolStripItem; 1207ToolStripItem toolStripItem = selectionService.PrimarySelection as ToolStripItem; 1210toolStripItem = ShiftPrimaryItem as ToolStripItem; 1213toolStripItem ??= SelectedDesignerControl as ToolStripItem; 1236ToolStripItem item = selectionService.PrimarySelection as ToolStripItem; 1272ToolStripItem owner = ((ToolStripDropDown)item.Owner).OwnerItem; 1334ToolStripItem item = selectionService.PrimarySelection as ToolStripItem; 1337item = ShiftPrimaryItem as ToolStripItem; 1340item ??= SelectedDesignerControl as ToolStripItem; 1403&& targetSelection is ToolStripItem newSelection) 1445&& targetSelection is ToolStripItem newSelection 1670ToolStripItem toolStripItem = null; 1690toolStripItem = selSvc.PrimarySelection as ToolStripItem; 1691toolStripItem ??= SelectedDesignerControl as ToolStripItem; 1836ToolStripItem item = selSvc.PrimarySelection as ToolStripItem; 1839item = ShiftPrimaryItem as ToolStripItem; 1842item ??= SelectedDesignerControl as ToolStripItem; 1850ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).OwnerItem; 1866ToolStripItem firstItem = GetNextItem(parent, null, ArrowDirection.Down); 2103ToolStripDesignerUtils.InvalidateSelection(origSel, targetSelection as ToolStripItem, _provider, _shiftPressed);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (52)
33private ToolStripItem _parentItem; 89foreach (ToolStripItem item in MenuItem.DropDownItems) 141foreach (ToolStripItem item in MenuItem.DropDownItems) 154ToolStripItem[] items = new ToolStripItem[MenuItem.DropDownItems.Count]; 156foreach (ToolStripItem item in items) 262ToolStripItem toolItem; 270toolItem = selectedItem as ToolStripItem; 274toolItem = selectedItem as ToolStripItem; 361foreach (ToolStripItem currentItem in dropDown.Items) 385internal void AddItemBodyGlyph(ToolStripItem item) 412foreach (ToolStripItem ddItem in item.DropDownItems) 442ToolStripItem editedItem = MenuItem.DropDownItems[index + 1]; 593ToolStripItem nextItem = (MenuItem.DropDownDirection == ToolStripDropDownDirection.AboveLeft || 637ToolStripItem editedItem = MenuItem.DropDownItems[index + 1]; 748private void CreateDummyMenuItem(ToolStripItem item, string text) 765private ToolStripItem CreateDummyItem(Type t, int dummyIndex) 773ToolStripItem newItem = null; 794newItem = (ToolStripItem)_designerHost.CreateComponent(t); 840private ToolStripItem CreateNewItem(Type t, int dummyIndex, string newText) 848ToolStripItem newItem = null; 866newItem = (ToolStripItem)_designerHost.CreateComponent(t, ToolStripDesigner.NameFromText(newText, t, MenuItem.Site)); 934ToolStripItem ownerLastSelected = lastDropDown.OwnerItem; 935ToolStripItem ownerCurrentSelected = currentDropDown.OwnerItem; 1068foreach (ToolStripItem item in MenuItem.DropDownItems) 1256if (KeyboardHandlingService.SelectedDesignerControl is ToolStripItem item) 1275ToolStripItem newDummyItem = null; 1323ToolStripItem ownerItem = dropDown.OwnerItem; 1341internal void EnterInSituEdit(ToolStripItem toolItem) 1412ToolStripItem topMostItem = topmost?.OwnerItem; 1430ToolStripItem ownerItem = dropDown.OwnerItem; 1461ToolStripItem ownerItem = MenuItem; 1563ToolStripItem topMostItem = firstDropDown.OwnerItem; 1649internal override ToolStripItem MorphCurrentItem(Type t) 1659ToolStripItem newItem = base.MorphCurrentItem(t); 1674if (e.Component is ToolStripItem newItem && _componentAddingFired && (MenuItemSelected || _fireComponentChanged)) 1710if (_selectionService.PrimarySelection is ToolStripItem selectedItem && selectedItem != MenuItem) 1848if (e.Component is ToolStripItem && (MenuItemSelected || _fireComponentChanged)) 1862if (e.Component is ToolStripItem itemAdding && itemAdding.Owner is null) 1877if (e.Component is ToolStripItem itemToBeDeleted && itemToBeDeleted.IsOnDropDown) 1960if (e.Component is ToolStripItem itemToBeDeleted && itemToBeDeleted.IsOnDropDown && itemToBeDeleted.Placement == ToolStripItemPlacement.Main) 2065foreach (ToolStripItem item in mainStripDesigner.Items) 2208if (selectedObj is ToolStripItem currentSelection) 2236if (selectedObj is ToolStripItem item) 2376foreach (ToolStripItem ddItem in item.DropDownItems) 2395internal void RemoveItemBodyGlyph(ToolStripItem item) 2539ToolStripItem[] selectedItems = new ToolStripItem[maxIndex - minIndex + 1]; 2681ToolStripItem primaryItem = data.PrimarySelection; 2694List<ToolStripItem> dragComponents = data.DragComponents; 2745primaryItem = components[primaryIndex] as ToolStripItem; 2756foreach (ToolStripItem toolItem in components)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (16)
96private ToolStripItem _activeItem; 122_activeItem = component as ToolStripItem; 240public ToolStripItem ActiveItem 283foreach (ToolStripItem item in templateNodeCustomMenuItemCollection) 537if (_component is ToolStripItem currentItem) 565if (cachedSelSvc.PrimarySelection is ToolStripItem selectedItem && _designerHost is not null) 830if (SelectionService.PrimarySelection is ToolStripItem curSel) 977internal void FocusEditor(ToolStripItem currentItem) 1208if (SelectionService.PrimarySelection is ToolStripItem && _renderer is not null && _renderer.State != (int)TemplateNodeSelectionState.HotRegionSelected) 1391_miniToolStrip.Items.AddRange((ToolStripItem[])[_centerLabel]); 1457_miniToolStrip.Items.AddRange((ToolStripItem[]) 1664private ToolStripItem GetSelectedItem() 1666ToolStripItem selectedItem = null; 1697ToolStripItem item = GetSelectedItem(); 1884ToolStripItem item = e.Item; 2043ToolStripItem item = e.Item as ToolStripLabel;
System.Windows.Forms.Design.Tests (4)
EnsureEditorsTests.cs (1)
135[InlineData(typeof(ToolStripItem), "ToolTipText", typeof(MultilineStringEditor))]
System\Windows\Forms\Design\ContextMenuStripGroupTests.cs (3)
15IList<ToolStripItem> items = contextMenuStripGroup.Items; 26IList<ToolStripItem> items1 = contextMenuStripGroup.Items; 27IList<ToolStripItem> items2 = contextMenuStripGroup.Items;
System.Windows.Forms.Tests (277)
BindingNavigatorTests.cs (2)
68List<ToolStripItem> items = 100ToolStripItem item = items[i];
System\Windows\Forms\AccessibleObjects\MenuStrip.MenuStripAccessibleObjectTests.cs (1)
948static ToolStripItem CreateMenuItem()
System\Windows\Forms\AccessibleObjects\StatusStrip.StatusStripAccessibleObjectTests.cs (1)
929static ToolStripItem CreateStatusStripItem()
System\Windows\Forms\AccessibleObjects\ToolStripAccessibleObjectTests.cs (2)
889internal static ToolStripItem CreateSkippedItem() 989static ToolStripItem CreateToolStripItem()
System\Windows\Forms\AccessibleObjects\ToolStripDropDownButton.ToolStripDropDownButtonAccessibleObjectTests.cs (2)
105ToolStripItem[] dropDownItems = [new ToolStripMenuItem("Test item")]; 107static ToolStripDropDownButton CreateToolStripDropDownButton(string text = null, Bitmap image = null, EventHandler onClick = null, string name = null, ToolStripItem[] dropDownItems = null)
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (19)
23var accessibleObject = new ToolStripItem.ToolStripItemAccessibleObject(item); 39Assert.Throws<ArgumentNullException>("ownerItem", () => new ToolStripItem.ToolStripItemAccessibleObject(null)); 44return ReflectionHelper.GetPublicNotAbstractClasses<ToolStripItem>().Select(type => new object[] { type }); 53using ToolStripItem item = ReflectionHelper.InvokePublicConstructor<ToolStripItem>(type); 67using ToolStripItem item = ReflectionHelper.InvokePublicConstructor<ToolStripItem>(type); 79using ToolStripItem item = ReflectionHelper.InvokePublicConstructor<ToolStripItem>(type); 92using ToolStripItem item = ReflectionHelper.InvokePublicConstructor<ToolStripItem>(type); 116using ToolStripItem item = ReflectionHelper.InvokePublicConstructor<ToolStripItem>(type); 132using ToolStripItem toolStripItem = new SubToolStripItem(); 160using ToolStripItem toolStripItem = new SubToolStripItem(); 174using ToolStripItem toolStripItem = new SubToolStripItem(); 183using ToolStripItem toolStripItem = new SubToolStripItem(); 193using ToolStripItem toolStripItem = new SubToolStripItem(); 312static ToolStripItem CreateSkippedItem()
System\Windows\Forms\AccessibleObjects\ToolStripOverflow.ToolStripOverflowAccessibleObjectTests.cs (1)
212static ToolStripItem CreateItem(ToolStripItemAlignment align)
System\Windows\Forms\AccessibleObjects\ToolStripScrollButton.ToolStripScrollButtonAccessibleObjectTests.cs (1)
163internal SubToolStripDropDownMenu(ToolStripItem ownerItem, bool isAutoGenerated, bool requiresScrollButtons) : base(ownerItem, isAutoGenerated)
System\Windows\Forms\AccessibleObjects\ToolStripSplitButton.ToolStripSplitButtonExAccessibleObjectTests.cs (4)
83ToolStripItem item1 = toolStripSplitButton.DropDownItems.Add(string.Empty); 84ToolStripItem item2 = toolStripSplitButton.DropDownItems.Add(string.Empty); 123ToolStripItem item1 = toolStripSplitButton.DropDownItems.Add(string.Empty); 124ToolStripItem item2 = toolStripSplitButton.DropDownItems.Add(string.Empty);
System\Windows\Forms\ControlTests.cs (4)
935toolStrip1.Items.AddRange((ToolStripItem[]) 945toolStrip2.Items.AddRange((ToolStripItem[]) 992toolStrip1.Items.AddRange((ToolStripItem[]) 1002toolStrip2.Items.AddRange((ToolStripItem[])
System\Windows\Forms\MdiControlStripTests.cs (29)
218ToolStripItem.ToolStripItemAccessibleObject systemItem = (ToolStripItem.ToolStripItemAccessibleObject)accessibleObject.TestAccessor().Dynamic.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild); 219ToolStripItem.ToolStripItemAccessibleObject test1Item = (ToolStripItem.ToolStripItemAccessibleObject)systemItem.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 220ToolStripItem.ToolStripItemAccessibleObject test2Item = (ToolStripItem.ToolStripItemAccessibleObject)test1Item.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 221ToolStripItem.ToolStripItemAccessibleObject minimizeItem = (ToolStripItem.ToolStripItemAccessibleObject)test2Item.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 222ToolStripItem.ToolStripItemAccessibleObject restoreItem = (ToolStripItem.ToolStripItemAccessibleObject)minimizeItem.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 223ToolStripItem.ToolStripItemAccessibleObject closeItem = (ToolStripItem.ToolStripItemAccessibleObject)restoreItem.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 224ToolStripItem.ToolStripItemAccessibleObject nullItem = (ToolStripItem.ToolStripItemAccessibleObject)closeItem.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling); 264ToolStripItem.ToolStripItemAccessibleObject closeItem = (ToolStripItem.ToolStripItemAccessibleObject)accessibleObject.TestAccessor().Dynamic.FragmentNavigate(NavigateDirection.NavigateDirection_LastChild); 265ToolStripItem.ToolStripItemAccessibleObject restoreItem = (ToolStripItem.ToolStripItemAccessibleObject)closeItem.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 266ToolStripItem.ToolStripItemAccessibleObject minimizeItem = (ToolStripItem.ToolStripItemAccessibleObject)restoreItem.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 267ToolStripItem.ToolStripItemAccessibleObject test2Item = (ToolStripItem.ToolStripItemAccessibleObject)minimizeItem.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 268ToolStripItem.ToolStripItemAccessibleObject test1Item = (ToolStripItem.ToolStripItemAccessibleObject)test2Item.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 269ToolStripItem.ToolStripItemAccessibleObject systemItem = (ToolStripItem.ToolStripItemAccessibleObject)test1Item.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 270ToolStripItem.ToolStripItemAccessibleObject nullItem = (ToolStripItem.ToolStripItemAccessibleObject)systemItem.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling); 430public new ToolStripItem CreateDefaultItem(string text, Image image, EventHandler onClick) => base.CreateDefaultItem(text, image, onClick);
System\Windows\Forms\MenuStripTests.cs (3)
483ToolStripItem item = Assert.IsAssignableFrom<ToolStripItem>(control.CreateDefaultItem(text, null, onClick)); 926public new ToolStripItem CreateDefaultItem(string text, Image image, EventHandler onClick) => base.CreateDefaultItem(text, image, onClick);
System\Windows\Forms\StatusStripTests.cs (3)
1068ToolStripItem button = Assert.IsAssignableFrom<ToolStripItem>(control.CreateDefaultItem(text, null, onClick)); 1348public new ToolStripItem CreateDefaultItem(string text, Image image, EventHandler onClick) => base.CreateDefaultItem(text, image, onClick);
System\Windows\Forms\ToolStrip.ToolStripAccessibleObjectWrapperForItemsOnOverflowTests.cs (1)
6using static System.Windows.Forms.ToolStripItem;
System\Windows\Forms\ToolStripArrowRenderEventArgsTests.cs (1)
28public void Ctor_Graphics_ToolStripItem_Rectangle_Color_ArrowDirection(Graphics g, ToolStripItem toolStripItem, Rectangle arrowRectangle, Color arrowColor, ArrowDirection arrowDirection)
System\Windows\Forms\ToolStripButtonTests.cs (10)
1003ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 1017ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 1031ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 1050ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 1069ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance());
System\Windows\Forms\ToolStripControlHostTests.cs (8)
2518ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 2537ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 2552ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 2565ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance());
System\Windows\Forms\ToolStripDropDownItemTests.cs (8)
294yield return new object[] { null, null, null, Array.Empty<ToolStripItem>() }; 295yield return new object[] { string.Empty, new Bitmap(10, 10), Array.Empty<ToolStripItem>(), Array.Empty<ToolStripItem>() }; 297var items = new ToolStripItem[] { new SubToolStripItem() }; 303public void ToolStripDropDownItem_Ctor_String_Image_ToolStripItemArray(string text, Image image, ToolStripItem[] dropDownItems, ToolStripItem[] expectedDropDownItems) 341Assert.Equal(expectedDropDownItems, item.DropDownItems.Cast<ToolStripItem>()); 505public SubToolStripDropDownItem(string text, Image image, params ToolStripItem[] dropDownItems) : base(text, image, dropDownItems)
System\Windows\Forms\ToolStripDropDownTests.cs (13)
2995ToolStripItem button = Assert.IsAssignableFrom<ToolStripItem>(control.CreateDefaultItem(text, null, onClick)); 3580Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 3599Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 3734public void ToolStripDropDown_OnClosed_Invoke_CallsClosed(ToolStripItem ownerItem, ToolStripDropDownClosedEventArgs eventArgs) 3763public void ToolStripDropDown_OnClosed_InvokeWithHandle_CallsClosed(ToolStripItem ownerItem, ToolStripDropDownClosedEventArgs eventArgs) 4619public void ToolStripDropDown_OnOpened_Invoke_CallsOpened(ToolStripItem ownerItem, EventArgs eventArgs) 4648public void ToolStripDropDown_OnOpened_InvokeWithHandle_CallsOpened(ToolStripItem ownerItem, EventArgs eventArgs) 4896ToolStripItem expected = items[4]; 4897ToolStripItem actual = toolStrip.DropDown.GetNextItem(start: null, direction: ArrowDirection.Up); 5170public new ToolStripItem CreateDefaultItem(string text, Image image, EventHandler onClick) => base.CreateDefaultItem(text, image, onClick);
System\Windows\Forms\ToolStripItemClickedEventArgsTests.cs (1)
16public void Ctor_ToolStripItem(ToolStripItem clickedItem)
System\Windows\Forms\ToolStripItemCollectionTests.cs (15)
153private ToolStripItem[] CreateToolStripItems(params (string Key, string Name)[] items) => 160ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 172ToolStripItem[] toolStripItems = items.Select(item => new ToolStripButton(item.Name) { Name = item.Key }).ToArray(); 260ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 273ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 286ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 317ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 320ToolStripItemCollection collection = new(toolStrip2, Array.Empty<ToolStripItem>()); 332ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2"), ("key3", "Item3")); 347ToolStripItem[] items = CreateToolStripItems(("key1", "Item1"), ("key2", "Item2")); 350ToolStripItemCollection collection = new(toolStrip2, Array.Empty<ToolStripItem>()); 363ToolStripItemCollection collection = new(toolStrip, Array.Empty<ToolStripItem>()); 366ToolStripItem item = collection.Add(image); 376ToolStripItemCollection collection = new(toolStrip, Array.Empty<ToolStripItem>()); 380ToolStripItem item = collection.Add(text, image);
System\Windows\Forms\ToolStripItemEventArgsTests.cs (1)
16public void Ctor_ToolStripItem(ToolStripItem item)
System\Windows\Forms\ToolStripItemImageRenderEventArgsTests.cs (3)
22public void ToolStripItemImageRenderEventArgs_Null_Graphics_ToolStripItem_ThrowsArgumentNullException(Graphics g, ToolStripItem toolStripItem) 62public void ToolStripItemImageRenderEventArgs_Ctor_Graphics_ToolStripItem_Rectangle(Graphics g, ToolStripItem item, Rectangle imageRectangle, Image expectedImage) 98public void ToolStripItemImageRenderEventArgs_Ctor_ToolStripItem_Image_Rectangle(ToolStripItem item, Image image, Rectangle imageRectangle)
System\Windows\Forms\ToolStripItemRenderEventArgsTests.cs (2)
22public void ToolStripItemRenderEventArgs_Null_Graphics_ToolStripItem_ThrowsArgumentNullException(Graphics g, ToolStripItem toolStripItem) 43public void Ctor_Graphics_ToolStripItem(Graphics g, ToolStripItem item, ToolStrip expectedToolStrip)
System\Windows\Forms\ToolStripItemTests.cs (82)
1736PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.BackColor)]; 1752PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.BackColor)]; 2329PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.DisplayStyle)]; 2345PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.DisplayStyle)]; 3178PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Font)]; 3207PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Font)]; 3429PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ForeColor)]; 3445PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ForeColor)]; 4083PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Image)]; 4100PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Image)]; 4128PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Image)]; 4145PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Image)]; 4736PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 4757PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 4782PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 4816PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 4836PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 4860PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageIndex)]; 5223PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5250PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5281PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5315PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5342PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5373PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageKey)]; 5780PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageTransparentColor)]; 5796PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ImageTransparentColor)]; 6097PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Margin)]; 6113PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Margin)]; 6646public void ToolStripItem_OwnerItem_GetWithDropDownOwner_ReturnsExpected(ToolStripItem result) 6672public void ToolStripItem_OwnerItem_GetWithDropDownParent_ReturnsExpected(ToolStripItem result) 6912PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Padding)]; 6928PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Padding)]; 7414PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.RightToLeft)]; 7442PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.RightToLeft)]; 8772PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.TextDirection)]; 8796PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.TextDirection)]; 9073PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ToolTipText)]; 9100PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.ToolTipText)]; 9596PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Visible)]; 9612PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(ToolStripItem))[nameof(ToolStripItem.Visible)]; 9837ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 13672ToolStripItem grip = Assert.IsAssignableFrom<ToolStripItem>(Assert.Single(control.DisplayedItems));
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
19public void Ctor_ToolStripItem_String_Rectangle_Color_Font_TextFormatFlags(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 45public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, ContentAlignment textAlign, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripMenuItemTests.cs (2)
244ToolStripItem[] dropDownItems = [new ToolStripMenuItem("SubItem1"), new ToolStripMenuItem("SubItem2")]; 421public SubToolStripMenuItem(string text, Image image, params ToolStripItem[] dropDownItems) : base(text, image, dropDownItems)
System\Windows\Forms\ToolStripRendererTests.cs (10)
42public void ToolStripRenderer_DrawArrow_Invoke_CallsRenderArrow(ToolStripItem toolStripItem, Rectangle arrowRectangle, Color arrowColor, ArrowDirection arrowDirection) 204public void ToolStripRenderer_DrawItemCheck_Invoke_CallsRenderItemCheck(Graphics graphics, ToolStripItem item, Image image, Rectangle imageRectangle) 237public void ToolStripRenderer_DrawItemImage_Invoke_CallsRenderItemImage(Graphics graphics, ToolStripItem item, Image image, Rectangle imageRectangle) 310public void ToolStripRenderer_DrawItemText_Invoke_CallsRenderItemText(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 700public void ToolStripRenderer_InitializeItem_Invoke_Nop(ToolStripItem item) 722public void ToolStripRenderer_OnRenderArrow_Invoke_Nop(ToolStripItem toolStripItem, Rectangle arrowRectangle, Color arrowColor, ArrowDirection arrowDirection) 799public void ToolStripRenderer_OnRenderItemCheck_Invoke_Nop(Graphics graphics, ToolStripItem item, Image image, Rectangle imageRectangle) 819public void ToolStripRenderer_OnRenderItemImage_Invoke_Nop(Graphics graphics, ToolStripItem item, Image image, Rectangle imageRectangle) 839public void ToolStripRenderer_OnRenderItemText_Invoke_Nop(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 1027public new void InitializeItem(ToolStripItem item) => base.InitializeItem(item);
System\Windows\Forms\ToolStripSeparatorTests.cs (4)
724ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance()); 737ToolStripItem.ToolStripItemAccessibleObject accessibleObject = Assert.IsAssignableFrom<ToolStripItem.ToolStripItemAccessibleObject>(item.CreateAccessibilityInstance());
System\Windows\Forms\ToolStripSplitButtonTests.cs (3)
21public static TheoryData<ToolStripItem?> ToolStripItem_Set_TestData() => 29public void ToolStripSplitButton_DefaultItem_Set_GetReturnsExpected(ToolStripItem? value) 164toolStripSplitButton.DropDownItems.Cast<ToolStripItem>().Should().ContainInOrder(new[] { item1, item2 });
System\Windows\Forms\ToolStripSplitStackDragDropHandlerTests.cs (3)
27dataObject.SetData(typeof(ToolStripItem), toolStripItem); 51dataObject.SetData(typeof(ToolStripItem), toolStripItem); 75dataObject.SetData(typeof(ToolStripItem), toolStripItem);
System\Windows\Forms\ToolStripTests.cs (36)
170yield return new object[] { Array.Empty<ToolStripItem>() }; 171yield return new object[] { new ToolStripItem[] { new SubToolStripItem() } }; 176public void ToolStrip_Ctor_ToolStripItemArray(ToolStripItem[] items) 273Assert.Equal(items, control.Items.Cast<ToolStripItem>()); 2736ToolStripItem grip = Assert.IsAssignableFrom<ToolStripItem>(Assert.Single(control.DisplayedItems)); 2745ToolStripItem grip = Assert.IsAssignableFrom<ToolStripItem>(Assert.Single(control.DisplayedItems)); 2786Assert.True(control.DisplayedItems.Cast<ToolStripItem>().All(i => i.Visible)); 2795ToolStripItem grip = Assert.IsAssignableFrom<ToolStripItem>(Assert.Single(control.DisplayedItems)); 4313ToolStripItem button = Assert.IsAssignableFrom<ToolStripItem>(control.CreateDefaultItem(text, null, onClick)); 4734Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 4753Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 4821ToolStripItem actual = toolStrip.GetNextItem(toolStrip.Items[0], ArrowDirection.Right); 4842ToolStripItem nextToolStripItem1 = toolStrip.GetNextItem(toolStripButton1, ArrowDirection.Right); 4843ToolStripItem nextToolStripItem2 = toolStrip.GetNextItem(toolStripButton2, ArrowDirection.Right); 4844ToolStripItem nextToolStripItem3 = toolStrip.GetNextItem(toolStripButton3, ArrowDirection.Right); 4867ToolStripItem actual = toolStrip.GetNextItem(toolStrip.Items[0], ArrowDirection.Left); 4888ToolStripItem previousToolStripItem1 = toolStrip.GetNextItem(toolStripButton1, ArrowDirection.Left); 4889ToolStripItem previousToolStripItem2 = toolStrip.GetNextItem(toolStripButton3, ArrowDirection.Left); 4890ToolStripItem previousToolStripItem3 = toolStrip.GetNextItem(toolStripButton2, ArrowDirection.Left); 6538ToolStripItem grip = Assert.IsAssignableFrom<ToolStripItem>(Assert.Single(control.DisplayedItems)); 7295toolStrip.Items.AddRange((ToolStripItem[])[toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3]); 7298ToolStripItem previousToolStripItem1 = toolStrip.GetNextItem(start: null, ArrowDirection.Left); 7301ToolStripItem previousToolStripItem2 = toolStrip.GetNextItem(start: null, ArrowDirection.Right); 7312using ToolStripItem toolStripItem = menuStrip.Items.Add("toolStripItem"); 7321WeakReference<ToolStripItem> currentItemWR; 7333using ToolStripItem toolStripItem = menuStrip.Items.Add("toolStripItem"); 7522public SubToolStrip(ToolStripItem[] items) : base(items) 7604public new ToolStripItem CreateDefaultItem(string text, Image image, EventHandler onClick) => base.CreateDefaultItem(text, image, onClick); 7688public new void SetItemLocation(ToolStripItem item, Point location) => base.SetItemLocation(item, location);
System.Windows.Forms.UI.IntegrationTests (2)
DragDropTests.cs (2)
1052ToolStripItem dragAcceptItem = new ToolStripMenuItem() 1080if (sender is not ToolStripItem dragAcceptItem)
WinFormsControlsTest (26)
DragDrop.cs (6)
471ToolStripItem dragAcceptItem = new ToolStripMenuItem() 482ToolStripItem nyanCatItem = new ToolStripMenuItem() 493ToolStripItem asciiCatItem = new ToolStripMenuItem() 534if (sender is ToolStripItem toolStripItem) 552if (sender is ToolStripItem toolStripItem) 564if (sender is ToolStripItem toolStripItem)
MenuStripAndCheckedListBox.Designer.cs (7)
67this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 83this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 116this.memoryCardFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 128this.navigationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 137this.newToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 145this.settingsEditorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 209this.checkStateSamplesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
ToolStripSeparatorPreferredSize.cs (1)
42_toolStrip1.Items.AddRange((ToolStripItem[])
ToolStripTests.Designer.cs (12)
83this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 97this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 117this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 129this.toolStrip4.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 148this.toolStrip4_MenuItem1.DropDownItems.AddRange(new ToolStripItem[] { toolStrip4_SubMenuItem }); 230this.toolStrip3_MenuItem2.DropDownItems.AddRange(new ToolStripItem[] { uncheckedCheckOnClickToolStripMenuItem, checkCheckOnClickToolStripMenuItem, checkedCheckOnClickFToolStripMenuItem, indeterminateToolStripMenuItem, indeterminateCheckOnClickFToolStripMenuItem }); 251this.checkCheckOnClickToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { thirdLevelItem, thirdLevelButton, toolStripComboBox2, toolStripTextBox2, toolStrip2_SplitButton2, toolStrip2_DropDownButton2 }); 285this.toolStrip2_SplitButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 303this.toolStrip2_DropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 345this.toolStrip2_SplitButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 368this.toolStrip2_DropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 378this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {