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