1 override of Items
System.Windows.Forms (1)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
34public override ToolStripItemCollection Items
987 references to Items
Accessibility_Core_App (12)
DataControls.Designer.cs (1)
77this.bindingNavigator1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
Menu_Toolbars_controls.Designer.cs (4)
110menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, editToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem, toolStripMenuItem1, toolStripComboBox1, toolStripTextBox1 }); 123contextMenuStrip1.Items.AddRange(new ToolStripItem[] { menuStripToolStripMenuItem, shortCutsToolStripMenuItem }); 421statusStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, toolStripSplitButton1, toolStripStatusLabel1, toolStripProgressBar1 }); 504toolStrip1.Items.AddRange(new ToolStripItem[] { newToolStripButton, toolStripSeparator7, toolStripButton1, toolStripButton2, toolStripButton3, toolStripButton4, toolStripButton5, toolStripButton6 });
PrintingControls.cs (2)
61((ToolStripButton)((ToolStrip)printPreviewDialog1.Controls[1]).Items[0]).Enabled = false;// disable the direct print from printpreview.as when we click that Print button PrintPage event fires again. 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 (3)
122this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 274this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 332this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
DesignSurface (5)
MainForm.cs (4)
307menuStrip1.Items.Add(toolStripMenuItem1); 308menuStrip1.Items.Add(toolStripMenuItem2); 309menuStrip2.Items.Add(menu1); 310menuStrip2.Items.Add(menuNew1);
MainForm.Designer.cs (1)
163this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
System.Windows.Forms (184)
System\Windows\Forms\ContextMenuStrip.cs (4)
64for (int i = 0; i < Items.Count; i++) 66ToolStripItem item = Items[i]; 70contextMenuStrip.Items.Add(new ToolStripSeparator()); 74contextMenuStrip.Items.Add(toolStripMenuItem.Clone());
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (2)
381for (int i = 0; i < Items.Count; i++) 383ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (43)
22[DefaultProperty(nameof(Items))] 160Items.AddRange(items); 875foreach (ToolStripItem item in Items) 935LayoutTransaction.DoLayoutIf((Items.Count > 0), this, this, PropertyNames.ImageScalingSize); 936foreach (ToolStripItem item in Items) 977foreach (ToolStripItem item in Items) 1626foreach (ToolStripItem item in Items) 1712for (int i = 0; i < Items.Count; i++) 1714Items[i].OnOwnerTextDirectionChanged(); 1911if (!Items.IsReadOnly) 1914for (int i = Items.Count - 1; i >= 0; i--) 1916Items[i].Dispose(); 1919Items.Clear(); 2281for (int j = 0; j < toolStrip.Items.Count; j++) 2283ToolStripItem item = toolStrip.Items[j]; 2302if (toolStrip.Items.Count == 0 || (!foundItemParticipatingInLayout)) 2340for (int j = 0; j < toolStrip.Items.Count; j++) 2342ToolStripItem item = toolStrip.Items[j]; 2361if (toolStrip.Items.Count == 0 || !foundItemParticipatingInLayout) 2522for (int i = 0; i < Items.Count; i++) 2524renderer.InitializeItem(Items[i]); 2701foreach (ToolStripItem item in Items) 3144for (int i = 0; i < Items.Count; i++) 3146if (Items[i] is not null && Items[i].ParentInternal == this) 3148Items[i].OnParentEnabledChanged(e); 3171for (int i = 0; i < Items.Count; i++) 3173Items[i].OnOwnerFontChanged(e); 3264for (int j = 0; j < Items.Count; j++) 3266Items[j].OnLayout(e); 3617for (int i = 0; i < Items.Count; i++) 3619Items[i].OnParentRightToLeftChanged(e); 3746foreach (ToolStripItem item in Items) 3922ReleaseToolStripItemsProviders(Items); 4049foreach (ToolStripItem item in Items) 4268for (; j >= 0 && j < Items.Count; j = (pass == 0) ? j + 1 : j - 1) 4270ToolStripItem item = Items[j]; 4334for (int j = 0; j < Items.Count; j++) 4336ToolStripItem item = Items[j]; 4479return $"{base.ToString()}, Name: {Name}, Items: {Items.Count}"; 4657get { return Items; } 4710int i = Items.Count; 4713ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (25)
43if (!this.TryGetOwnerAs(out ToolStrip? owner) || owner.Items is null) 57if (index < owner.Items.Count) 63for (int i = 0; i < owner.Items.Count; ++i) 65if (owner.Items[i].Available && owner.Items[i].Alignment == ToolStripItemAlignment.Left) 69item = owner.Items[i]; 80for (int i = 0; i < owner.Items.Count; ++i) 82if (owner.Items[i].Available && owner.Items[i].Alignment == ToolStripItemAlignment.Right) 86item = owner.Items[i]; 109if (owner.CanOverflow && owner.OverflowButton.Visible && index == owner.Items.Count) 123if (!this.TryGetOwnerAs(out ToolStrip? owner) || owner.Items is null) 129for (int i = 0; i < owner.Items.Count; i++) 131if (owner.Items[i].Available) 281if (!this.TryGetOwnerAs(out ToolStrip? owner) || owner.Items is null) 326if (!this.TryGetOwnerAs(out ToolStrip? owner) || owner.Items is null) 344return owner.Items.Count + index; 348for (int i = 0; i < owner.Items.Count; ++i) 350if (owner.Items[i].Available && owner.Items[i].Alignment == ToolStripItemAlignment.Left) 352if (child.Owner == owner.Items[i]) 362for (int i = 0; i < owner.Items.Count; ++i) 364if (owner.Items[i].Available && owner.Items[i].Alignment == ToolStripItemAlignment.Right) 366if (child.Owner == owner.Items[i])
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (2)
245=> DropDown.Items; 781foreach (ToolStripItem childItem in item.DropDown.Items)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (36)
266managedDropDown.Items.Add(itemToAdd); 282for (int i = 0; i < Items.Count; i++) 284ToolStripItem item = Items[i]; 479int index = Items.IndexOf(nextItem); 483if ((Items[index].Visible && displayRect.Contains(displayRect.X, Items[index].Bounds.Top - delta)) 484|| !Items[index].Visible) 496if (displayRect.Contains(displayRect.X, Items[index].Bounds.Bottom - delta)) 499delta += (Items[index].Bounds.Bottom - delta) - displayRect.Top; 621if (Items.Count > 0) 623int delta = Items[0].Bounds.Top - DisplayRectangle.Top; 644if (!RequiresScrollButtons || Items.Count == 0) 656int alreadyScrolled = displayRectangle.Top - Items[0].Bounds.Top; 663for (int i = 0; i < Items.Count && deltaToScroll < requiredScrollAmount; ++i) 665if (Items[i].Available) 667Rectangle adjustedLastItemBounds = Items[Items.Count - 1].Bounds; 677if (i < Items.Count - 1) 679deltaToScroll += Items[i + 1].Bounds.Top - Items[i].Bounds.Top; 683deltaToScroll += Items[i].Bounds.Height; 690for (int i = Items.Count - 1; i >= 0 && deltaToScroll > requiredScrollAmount; --i) 692if (Items[i].Available) 694Rectangle adjustedLastItemBounds = Items[0].Bounds; 706deltaToScroll -= Items[i].Bounds.Top - Items[i - 1].Bounds.Top; 710deltaToScroll -= Items[i].Bounds.Height; 717_scrollAmount = DisplayRectangle.Top - Items[0].Bounds.Top; 734if (_indexOfFirstDisplayedItem == -1 || _indexOfFirstDisplayedItem >= Items.Count) 752ToolStripItem itemTop = Items[_indexOfFirstDisplayedItem - 1]; 753ToolStripItem itemBottom = Items[_indexOfFirstDisplayedItem]; 760if (_indexOfFirstDisplayedItem == Items.Count - 1) 766ToolStripItem itemTop = Items[_indexOfFirstDisplayedItem]; 767ToolStripItem itemBottom = Items[_indexOfFirstDisplayedItem + 1]; 821for (int i = 0; i < Items.Count; ++i) 823ToolStripItem item = Items[i];
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (2)
33for (int i = 0; i < _owner.Items.Count; i++) 35if (_owner.Items[i].AllowDrop)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (5)
1412_owner?.Items.Remove(this); 1414value?.Items.Add(this); 2065if (ParentInternal is not null && ParentInternal.Items.Contains(this) && ParentInternal.AllowItemReorder) 2102Debug.Assert(Owner.Items.Contains(this), "How can there be a owner and not be in the collection?"); 2103Owner.Items.Remove(this);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (5)
468int indexOfItem = value.ParentInternal.Items.IndexOf(value); 471value.ParentInternal.Items.RemoveAt(indexOfItem); 489int indexOfItem = value.ParentInternal.Items.IndexOf(value); 493value.ParentInternal.Items.RemoveAt(indexOfItem); 511item.Owner?.Items.Remove(item);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (9)
200foreach (ToolStripItem item in toolStrip.Items) 1107int originalCount = sourceToolStrip.Items.Count; 1120ToolStripItem item = sourceToolStrip.Items[itemToLookAt]; 1121MergeRecursive(item, targetToolStrip.Items, mergeHistory.MergeHistoryItemsStack); 1123int numberOfItemsMerged = lastCount - sourceToolStrip.Items.Count; 1125lastCount = sourceToolStrip.Items.Count; 1206PreviousIndexCollection = source.Owner!.Items 1226PreviousIndexCollection = source.Owner!.Items 1241PreviousIndexCollection = source.Owner!.Items
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.StickyLabelAccessibleObject.cs (4)
31=> _owner.UpDirection && toolStripDropDownMenu.Items.Count > 0 32? toolStripDropDownMenu.Items[0].AccessibilityObject 35=> !_owner.UpDirection && toolStripDropDownMenu.Items.Count > 0 36? toolStripDropDownMenu.Items[^1].AccessibilityObject
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (8)
74if (toolStrip.Items.Count == 0) 79StringBuilder itemNames = new(toolStrip.Items.Count); 81for (int i = 0; i < toolStrip.Items.Count; i++) 83itemNames.Append(toolStrip.Items[i].Name ?? "null"); 192for (int i = 0; ((i < toolStrip.Items.Count) && (i < keys.Length)); i++) 200toolStrip.Items.Insert(i, value.Items[key]!); 219foreach (ToolStripItem item in toolStrip.Items)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonExAccessibleObject.cs (3)
81NavigateDirection.NavigateDirection_FirstChild => DropDownItemsCount > 0 ? _owningToolStripSplitButton.DropDown.Items[0].AccessibilityObject : null, 82NavigateDirection.NavigateDirection_LastChild => DropDownItemsCount > 0 ? _owningToolStripSplitButton.DropDown.Items[_owningToolStripSplitButton.DropDown.Items.Count - 1].AccessibilityObject : null,
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (11)
74ToolStripItem item = _owner.Items[toolStripItemIndex]; 116if (_owner.Items.IndexOf(droppedItem) < insertIndex) 121_owner.Items.MoveItem(Math.Max(0, insertIndex), droppedItem); 124else if (toolStripItemIndex == -1 && _owner.Items.Count == 0) 126_owner.Items.Add(droppedItem); 136ToolStripItem item = _owner.Items[i]; 159else if (_owner.Items.Count == 0) 179return _owner.Items.IndexOf(_owner.DisplayedItems[i]); 191return _owner.Items.IndexOf(_owner.DisplayedItems[i - 1]); 194return _owner.Items.IndexOf(_owner.DisplayedItems[i]); 198return _owner.Items.IndexOf(_owner.DisplayedItems[_owner.DisplayedItems.Count - 1]);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (16)
67for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < toolStrip.Items.Count; ForwardsWalkingIndex++) 69ToolStripItem item = toolStrip.Items[ForwardsWalkingIndex]; 117for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < ToolStrip.Items.Count; ForwardsWalkingIndex++) 119ToolStripItem item = toolStrip.Items[ForwardsWalkingIndex]; 239for (int j = -1; j < toolStrip.Items.Count; j++) 261item = toolStrip.Items[j]; 381for (int j = -1; j < ToolStrip.Items.Count; j++) 404item = toolStrip.Items[j]; 523for (int i = 0; i < toolStrip.Items.Count; i++) 525ToolStripItem item = toolStrip.Items[i]; 547for (int i = 0; i < toolStrip.Items.Count; i++) 549if (toolStrip.Items[i].Placement == ToolStripItemPlacement.Overflow) 551toolStrip.Items[i].ParentInternal = null; 554toolStrip.Items[i].SetPlacement(ToolStripItemPlacement.None); 567BackwardsWalkingIndex = (backIndex == -1) ? ToolStrip.Items.Count - 1 : backIndex - 1; 570ToolStripItem item = ToolStrip.Items[BackwardsWalkingIndex];
System\Windows\Forms\DataBinding\BindingNavigator.cs (1)
219Items.AddRange(
System\Windows\Forms\MDI\MDIControlStrip.cs (4)
45Items.AddRange(_minimize, _restore, _close, _system); 48foreach (ToolStripItem item in Items) 97Debug.Assert(Items.Count <= 4, "Too many items in the MDIControlStrip. How did we get into this situation?"); 126_system.DropDown.Items.Clear();
System\Windows\Forms\MDI\MdiWindowListStrip.cs (1)
40Items.Add(_mergeItem);
System\Windows\Forms\Printing\PrintPreviewDialog.cs (3)
786_toolStrip1.Items.AddRange( 962_toolStrip1.Items.Add(_pageCounterItem); 963_toolStrip1.Items.Add(_pageToolStripLabel);
System.Windows.Forms.Design (161)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
72addDownMenu.Items.Add(new TypeMenuItem(newItemTypes[i], addDownMenuClick));
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (2)
144Items.Remove(_panel); 158Items.Add(_panel);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (4)
74index = Items.IndexOf(_selectionMenuItem); 76Items.Remove(_selectionMenuItem); 145Items.Insert(index, _selectionMenuItem); 242foreach (ToolStripItem item in Items)
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (1)
61SiteItems(host: host, items: navigator.Items); // Recursively site and name all the items on the strip
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (5)
47Items.Clear(); 54if (Items.Count > 0 && items.Count > 0) 56Items.Add(new ToolStripSeparator()); 61Items.Add(item); 80e.Cancel = (Items.Count == 0);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (2)
209tool.Items.Add(rootItem); 353tool.Items.Add(item);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (15)
355menu.Items.AddRange((ToolStripItem[])[add, insert, delete, separator, label, absolute, percent, autosize]); 1593menu.Items["add"].Enabled = enabled; 1594menu.Items["insert"].Enabled = enabled; 1595menu.Items["delete"].Enabled = enabled; 1596menu.Items["sizemode"].Enabled = enabled; 1597menu.Items["absolute"].Enabled = enabled; 1598menu.Items["percent"].Enabled = enabled; 1599menu.Items["autosize"].Enabled = enabled; 1603((ToolStripMenuItem)menu.Items["absolute"]).Checked = false; 1604((ToolStripMenuItem)menu.Items["percent"]).Checked = false; 1605((ToolStripMenuItem)menu.Items["autosize"]).Checked = false; 1611((ToolStripMenuItem)menu.Items["absolute"]).Checked = true; 1614((ToolStripMenuItem)menu.Items["percent"]).Checked = true; 1617((ToolStripMenuItem)menu.Items["autosize"]).Checked = true; 1627menu.Items["delete"].Enabled = false;
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (2)
68int dummyIndex = parent.Items.IndexOf(_currentItem); 111parent.Items.Insert(dummyIndex, (ToolStripItem)component);
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (2)
18if (toolStrip.Items.Count == 0) 23foreach (ToolStripItem item in toolStrip.Items)
System\Windows\Forms\Design\ToolStripDesigner.cs (30)
147foreach (ToolStripItem item in ToolStrip.Items) 466foreach (ToolStripItem item in ToolStrip.Items) 734ToolStrip.Items.Add(_editorNode); 905int count = ToolStrip.Items.Count; 915int indexToInsert = ToolStrip.Items.IndexOf(selectedItem); 916ToolStrip.Items.Insert(indexToInsert, newItem); 922ToolStrip.Items.Insert(count - 1, newItem); 926ToolStrip.Items.Add(newItem); 1036int itemIndex = ToolStrip.Items.IndexOf(item); 1042ToolStrip.Items.Remove(item); 1056if (ToolStrip.Items.Count > 1) 1058itemIndex = Math.Min(ToolStrip.Items.Count - 1, itemIndex); 1084IComponent targetSelection = (itemIndex == -1) ? ToolStrip : ToolStrip.Items[itemIndex]; 1275if (ToolStrip.Items.Count > 0) 1277ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.Count]; 1278ToolStrip.Items.CopyTo(items, 0); 1296foreach (ToolStripItem item in ToolStrip.Items) 1809if (offset.X >= parentToolStrip.Items[0].Bounds.X) 1814else if (offset.X <= parentToolStrip.Items[0].Bounds.X) 1821if (offset.Y <= parentToolStrip.Items[0].Bounds.Y) 1901parentToolStrip.Items.Insert(0, components[i] as ToolStripItem); 1905parentToolStrip.Items.Add(components[i] as ToolStripItem); 1959int currentIndexOfEditor = ToolStrip.Items.IndexOf(_editorNode); 1960if (currentIndexOfEditor == -1 || currentIndexOfEditor != ToolStrip.Items.Count - 1) 1964ToolStrip.Items.Add(_editorNode); 2050foreach (ToolStripItem item in ToolStrip.Items) 2125if (_editorNode is not null && (ToolStrip.Items.IndexOf(_editorNode) == -1)) 2127ToolStrip.Items.Add(_editorNode); 2229foreach (ToolStripItem item in ToolStrip.Items) 2463foreach (ToolStripItem item in ToolStrip.Items)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (8)
80get => ((ToolStrip)Component).Items; 397_designMenu.Items.Add(_menuItem); 626int count = _dropDown.Items.Count - 1; 629ShowMenu(_dropDown.Items[count]); 667if (_dropDown.Items.Count > 0) 669ToolStripItem[] items = new ToolStripItem[_dropDown.Items.Count]; 670_dropDown.Items.CopyTo(items, 0); 675_dropDown.Items.Remove(toolItem);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (10)
405int startIndexOfSelection = Math.Min(parent.Items.IndexOf(selectedItem), parent.Items.IndexOf(glyphItem)); 406int endIndexOfSelection = Math.Max(parent.Items.IndexOf(selectedItem), parent.Items.IndexOf(glyphItem)); 420totalObjects[j++] = parent.Items[i]; 736int indexOfItemUnderMouseToDrop = parentToolStrip.Items.IndexOf(ToolStripDesigner.s_dragItem); 742indexOfPrimarySelection = parentToolStrip.Items.IndexOf(selectedItem); 752parentToolStrip.Items.Insert(indexOfItemUnderMouseToDrop, item); 987parentDesigner.IndexOfItemUnderMouseToDrag = parentToolStrip.Items.IndexOf(glyphItem); 1010ownerItemDesigner._indexOfItemUnderMouseToDrag = parentDropDown.Items.IndexOf(glyphItem);
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (8)
374int dummyIndex = parent.Items.IndexOf(_currentItem); 397parent.Items.Insert(dummyIndex, (ToolStripItem)component); 436int dummyIndex = parent.Items.IndexOf(_currentItem); 449parent.Items.Insert(dummyIndex, (ToolStripItem)component); 475int dummyIndex = parent.Items.IndexOf(_currentItem); 488parent.Items.Insert(dummyIndex, (ToolStripItem)component); 515int dummyIndex = parent.Items.IndexOf(_currentItem); 545parent.Items.Insert(dummyIndex, (ToolStripItem)component);
System\Windows\Forms\Design\ToolStripItemDesigner.cs (8)
733int dummyIndex = parent.Items.IndexOf(ToolStripItem); 795parent.Items.Remove(ToolStripItem); 840parent.Items.Insert(dummyIndex, newItem); 886parent.Items.Insert(dummyIndex, ToolStripItem); 955focusIndex = owner.Items.IndexOf(currentSelection); 1071parent.Items.Remove(ToolStripItem); 1126int currentIndex = parent.Items.IndexOf(ToolStripItem); 1127ToolStripItem nextItem = parent.Items[currentIndex + 1];
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (25)
180focusIndex = owner.Items.IndexOf(curDesignerNode); 683int count = parent.Items.Count; 691int endIndexOfSelection = Math.Max(0, parent.Items.IndexOf(item)); 698totalObjects[j++] = parent.Items[i]; 705SetSelection(parent.Items[0]); 728int count = parent.Items.Count; 735int startIndexOfSelection = parent.Items.IndexOf(item); 743totalObjects[j++] = parent.Items[i]; 750SetSelection(parent.Items[count - 2]); 1406if (parentToMoveOn.Items.IndexOf(newSelection) != -1 1407&& parentToMoveOn.Items.IndexOf(newSelection) <= parentToMoveOn.Items.IndexOf(item)) 1449if (parentToMoveOn.Items.IndexOf(newSelection) != -1 1450&& parentToMoveOn.Items.IndexOf(newSelection) >= parentToMoveOn.Items.IndexOf(item)) 1826ToolStripItemCollection collection = wb.Items; 1829targetSelection = !backwards ? collection[0] : (object)collection[wb.Items.Count - 1]; 1881else if (item == parent.Items[0] && parent.RightToLeft != RightToLeft.Yes) 1931else if (item == parent.Items[0] && parent.RightToLeft == RightToLeft.Yes) 1969ToolStripItemCollection collection = parent.Items; 1974ToolStripItemCollection collection = parent.Items; 2025object[] totalObjects = new object[parent.Items.Count - 1]; 2026for (int i = 0; i < parent.Items.Count - 1; i++) 2028if (parent.Items[i] is DesignerToolStripControlHost) 2033totalObjects[i] = parent.Items[i];
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (27)
361foreach (ToolStripItem currentItem in dropDown.Items) 371dropDown.Items.Remove(_typeHereNode); 381dropDown.Items.Add(_typeHereNode); 445MenuItem.DropDown.Items.Remove(_commitedEditorNode); 638MenuItem.DropDown.Items.Remove(_commitedEditorNode); 735MenuItem.DropDown.Items.Add(_typeHereNode); 1387for (int i = 0; i < wb.Items.Count; i++) 1389Rectangle bounds = wb.Items[i].Bounds; 1390bounds.Inflate(wb.Items[i].Margin.Size); 1393return wb.Items.IndexOf(wb.Items[i]); 1700MenuItem.DropDown.Items.Insert(_indexToInsertNewItem, newItem); 1718MenuItem.DropDown.Items.Insert(index + 1, newItem); 1729MenuItem.DropDown.Items.Insert(index, newItem); 1746MenuItem.DropDown.Items.Insert(count - 1, newItem); 1758MenuItem.DropDown.Items.Add(newItem); 2033int currentIndexOfEditor = MenuItem.DropDown.Items.IndexOf(_typeHereNode); 2034if (currentIndexOfEditor >= 0 && currentIndexOfEditor < MenuItem.DropDown.Items.Count - 1) 2039MenuItem.DropDown.Items.Remove(_typeHereNode); 2040MenuItem.DropDown.Items.Add(_typeHereNode); 2353MenuItem.DropDown.Items.Remove(_commitedEditorNode); 2537int maxIndex = Math.Max(ownerDropDown.Items.IndexOf(oldSelection), ownerDropDown.Items.IndexOf(MenuItem)); 2538int minIndex = Math.Min(ownerDropDown.Items.IndexOf(oldSelection), ownerDropDown.Items.IndexOf(MenuItem)); 2543selectedItems[i] = ownerDropDown.Items[minIndex]; 2758parentToolStrip.Items.Add(toolItem);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (11)
901int index = _miniToolStrip.Items.IndexOf(_centerLabel); 905_miniToolStrip.Items.Insert(index, _centerTextBox); 906_miniToolStrip.Items.Remove(_centerLabel); 944int index = _miniToolStrip.Items.IndexOf(_centerTextBox); 950_miniToolStrip.Items.Insert(index, _centerLabel); 951_miniToolStrip.Items.Remove(_centerTextBox); 1391_miniToolStrip.Items.AddRange((ToolStripItem[])[_centerLabel]); 1457_miniToolStrip.Items.AddRange((ToolStripItem[]) 1667for (int i = 0; i < Items.Count; i++) 1669if (Items[i].Selected) 1671selectedItem = Items[i];
System.Windows.Forms.Design.Tests (10)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (2)
24contextMenuStrip.Items.Add(new ToolStripMenuItem()); 30foreach (var item in contextMenuStrip.Items.OfType<ToolStripMenuItem>())
System\Windows\Forms\Design\GroupedContextMenuStripTests.cs (4)
15groupedContextMenuStrip.Items.Count.Should().Be(0); 28groupedContextMenuStrip.Items.Count.Should().Be(1); 44groupedContextMenuStrip.Items.Count.Should().Be(3); 45groupedContextMenuStrip.Items[1].Should().BeOfType<ToolStripSeparator>();
ToolStripDesignerTests.cs (2)
44toolStrip.Items.Add("123"); 45toolStrip.Items.Add("abc");
ToolStripDropDownDesignerTest.cs (2)
39toolStripDropDown.Items.Add("123"); 40toolStripDropDown.Items.Add("456");
System.Windows.Forms.Tests (583)
BindingNavigatorTests.cs (26)
113Assert.Equal(11, bn.Items.Count); 114Assert.Equal(bn.MoveFirstItem, bn.Items[index++]); 115Assert.Equal(bn.MovePreviousItem, bn.Items[index++]); 116Assert.NotNull(bn.Items[index]); 117Assert.IsType<ToolStripSeparator>(bn.Items[index++]); 118Assert.Equal(bn.PositionItem, bn.Items[index++]); 119Assert.Equal(bn.CountItem, bn.Items[index++]); 120Assert.NotNull(bn.Items[index]); 121Assert.IsType<ToolStripSeparator>(bn.Items[index++]); 122Assert.Equal(bn.MoveNextItem, bn.Items[index++]); 123Assert.Equal(bn.MoveLastItem, bn.Items[index++]); 124Assert.NotNull(bn.Items[index]); 125Assert.IsType<ToolStripSeparator>(bn.Items[index++]); 126Assert.Equal(bn.AddNewItem, bn.Items[index++]); 127Assert.Equal(bn.DeleteItem, bn.Items[index++]); 199navigator.Items[0].Name.Should().Be("bindingNavigatorMoveFirstItem"); 200navigator.Items[1].Name.Should().Be("bindingNavigatorMovePreviousItem"); 201navigator.Items[2].Name.Should().Be("bindingNavigatorSeparator1"); 202navigator.Items[3].Name.Should().Be("bindingNavigatorPositionItem"); 203navigator.Items[4].Name.Should().Be("bindingNavigatorCountItem"); 204navigator.Items[5].Name.Should().Be("bindingNavigatorSeparator2"); 205navigator.Items[6].Name.Should().Be("bindingNavigatorMoveNextItem"); 206navigator.Items[7].Name.Should().Be("bindingNavigatorMoveLastItem"); 207navigator.Items[8].Name.Should().Be("bindingNavigatorSeparator3"); 208navigator.Items[9].Name.Should().Be("bindingNavigatorAddNewItem"); 209navigator.Items[10].Name.Should().Be("bindingNavigatorDeleteItem");
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (11)
1436Assert.Throws<ArgumentException>(() => toolStrip.Items.Add(host)); 1441toolStrip.Items.Add(host); 1503Assert.Throws<ArgumentException>(() => toolStrip.Items.Add(host)); 1508toolStrip.Items.Add(host); 1535toolStrip.Items.Add(label); 1540Assert.Throws<ArgumentException>(() => toolStrip.Items.Add(host)); 1545toolStrip.Items.Add(host); 1546toolStrip.Items.Add(button); 1572toolStrip.Items.Add(label); 1577Assert.Throws<ArgumentException>(() => toolStrip.Items.Add(host)); 1582toolStrip.Items.Add(host);
System\Windows\Forms\AccessibleObjects\MenuStrip.MenuStripAccessibleObjectTests.cs (59)
233AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 351AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 362menuStrip.Items.Insert(0, CreateSkippedItem()); 367AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 378menuStrip.Items.Add(CreateSkippedItem()); 379menuStrip.Items.Add(CreateSkippedItem()); 394menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 399AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 410menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 415AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 426menuStrip.Items.Insert(0, CreateSkippedItem()); 428menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 433AccessibleObject expected = menuStrip.Items[2].AccessibilityObject; 444menuStrip.Items.Insert(0, CreateSkippedItem()); 446menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 451AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 462menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 463menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 468AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 479menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 480menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 485AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 542AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 576menuStrip.Items.Add(CreateSkippedItem()); 581AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 592menuStrip.Items.Add(CreateSkippedItem()); 593menuStrip.Items.Add(CreateSkippedItem()); 608menuStrip.Items.Add(CreateSkippedItem()); 609menuStrip.Items.Add(CreateSkippedItem()); 625menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 630AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 641menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 646AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 657menuStrip.Items.Insert(0, CreateSkippedItem()); 658menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 660menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 662menuStrip.Items.Add(CreateSkippedItem()); 663menuStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 668AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 679menuStrip.Items.Insert(0, CreateSkippedItem()); 680menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 682menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 684menuStrip.Items.Add(CreateSkippedItem()); 685menuStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 690AccessibleObject expected = menuStrip.Items[2].AccessibilityObject; 701menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 702menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 707AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 718menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 719menuStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 724AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 789AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 827menuStrip.Items.Insert(1, CreateSkippedItem()); 832AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 863menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 866AccessibleObject expected = menuStrip.Items[0].AccessibilityObject; 888menuStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 891AccessibleObject expected = menuStrip.Items[1].AccessibilityObject; 936menuStrip.Items.Add(CreateMenuItem());
System\Windows\Forms\AccessibleObjects\StatusStrip.StatusStripAccessibleObjectTests.cs (59)
213AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 331AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 342statusStrip.Items.Insert(0, CreateSkippedItem()); 347AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 358statusStrip.Items.Add(CreateSkippedItem()); 359statusStrip.Items.Add(CreateSkippedItem()); 374statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 379AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 390statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 395AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 406statusStrip.Items.Insert(0, CreateSkippedItem()); 408statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 413AccessibleObject expected = statusStrip.Items[2].AccessibilityObject; 424statusStrip.Items.Insert(0, CreateSkippedItem()); 426statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 431AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 442statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 443statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 448AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 459statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 460statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 465AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 522AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 556statusStrip.Items.Add(CreateSkippedItem()); 561AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 572statusStrip.Items.Add(CreateSkippedItem()); 573statusStrip.Items.Add(CreateSkippedItem()); 588statusStrip.Items.Add(CreateSkippedItem()); 589statusStrip.Items.Add(CreateSkippedItem()); 605statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 610AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 621statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 626AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 637statusStrip.Items.Insert(0, CreateSkippedItem()); 638statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 640statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 642statusStrip.Items.Add(CreateSkippedItem()); 643statusStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 648AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 659statusStrip.Items.Insert(0, CreateSkippedItem()); 660statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 662statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 664statusStrip.Items.Add(CreateSkippedItem()); 665statusStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 670AccessibleObject expected = statusStrip.Items[2].AccessibilityObject; 681statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 682statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 687AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 698statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 699statusStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 704AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 769AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 807statusStrip.Items.Insert(1, CreateSkippedItem()); 812AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 843statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 846AccessibleObject expected = statusStrip.Items[0].AccessibilityObject; 869statusStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 872AccessibleObject expected = statusStrip.Items[1].AccessibilityObject; 917statusStrip.Items.Add(CreateStatusStripItem());
System\Windows\Forms\AccessibleObjects\ToolStripAccessibleObjectTests.cs (59)
226AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 344AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 355toolStrip.Items.Insert(0, CreateSkippedItem()); 360AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 371toolStrip.Items.Add(CreateSkippedItem()); 372toolStrip.Items.Add(CreateSkippedItem()); 387toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 392AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 403toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 408AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 419toolStrip.Items.Insert(0, CreateSkippedItem()); 421toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 426AccessibleObject expected = toolStrip.Items[2].AccessibilityObject; 437toolStrip.Items.Insert(0, CreateSkippedItem()); 439toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 444AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 455toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 456toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 461AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 472toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 473toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 478AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 535AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 569toolStrip.Items.Add(CreateSkippedItem()); 574AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 585toolStrip.Items.Add(CreateSkippedItem()); 586toolStrip.Items.Add(CreateSkippedItem()); 601toolStrip.Items.Add(CreateSkippedItem()); 602toolStrip.Items.Add(CreateSkippedItem()); 618toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 623AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 634toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 639AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 650toolStrip.Items.Insert(0, CreateSkippedItem()); 651toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 653toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 655toolStrip.Items.Add(CreateSkippedItem()); 656toolStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 661AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 672toolStrip.Items.Insert(0, CreateSkippedItem()); 673toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 675toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 677toolStrip.Items.Add(CreateSkippedItem()); 678toolStrip.Items[3].Alignment = ToolStripItemAlignment.Right; 683AccessibleObject expected = toolStrip.Items[2].AccessibilityObject; 694toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 695toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 700AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 711toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 712toolStrip.Items[1].Alignment = ToolStripItemAlignment.Right; 717AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 782AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 820toolStrip.Items.Insert(1, CreateSkippedItem()); 825AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 856toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 859AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 881toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 884AccessibleObject expected = toolStrip.Items[1].AccessibilityObject; 977toolStrip.Items.Add(CreateToolStripItem());
System\Windows\Forms\AccessibleObjects\ToolStripComboBox.ToolStripComboBoxAccessibleObjectTests.cs (1)
13toolStrip.Items.Add(toolStripComboBox);
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripControlHostAccessibleObjectTests.cs (1)
72toolStrip.Items.Add(toolStripControlHost);
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripHostedControlAccessibleObjectTests.cs (1)
24toolStrip.Items.Add(item);
System\Windows\Forms\AccessibleObjects\ToolStripDropDownButton.ToolStripDropDownButtonAccessibleObjectTests.cs (2)
79toolStrip.Items.Add(dropDownItem); 84AccessibleObject accessibleObject = toolStrip.Items[0].AccessibilityObject;
System\Windows\Forms\AccessibleObjects\ToolStripDropDownItemAccessibleObjectTests.cs (6)
63control.DropDown.Items.Add(new SubToolStripDropDownItem()); 82control.DropDown.Items.Add(new SubToolStripDropDownItem()); 95control.DropDown.Items.Add(new SubToolStripDropDownItem() { Available = true }); 120control.DropDown.Items.AddRange(new[] { item1, item2 }); 138control.DropDown.Items.AddRange(new[] { item1, item2 }); 157control.DropDown.Items.AddRange(new[] { item1, item2 });
System\Windows\Forms\AccessibleObjects\ToolStripDropDownMenu.ToolStripDropDownMenuAccessibleObjectTests.cs (2)
34toolStrip.Items.Add(item); 116toolStrip.Items.Add(ownerItem);
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (26)
118toolStrip.Items.Add(item); 204toolStrip.Items.Add(string.Empty); 208AccessibleObject accessibleObject = toolStrip.Items[0].AccessibilityObject; 218toolStrip.Items.Add(string.Empty); 220AccessibleObject accessibleObject = toolStrip.Items[0].AccessibilityObject; 230toolStrip.Items.Add(string.Empty); 232AccessibleObject accessibleObject = toolStrip.Items[0].AccessibilityObject; 244toolStrip.Items.Add(string.Empty); 245toolStrip.Items.Add(string.Empty); 250AccessibleObject item1 = toolStrip.Items[0].AccessibilityObject; 251AccessibleObject item2 = toolStrip.Items[1].AccessibilityObject; 269toolStrip.Items.Add(string.Empty); 273AccessibleObject accessibleObject = toolStrip.Items[0].AccessibilityObject; 285toolStrip.Items.Add(string.Empty); 286toolStrip.Items.Add(string.Empty); 288toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 293AccessibleObject item1 = toolStrip.Items[0].AccessibilityObject; 294AccessibleObject item2 = toolStrip.Items[1].AccessibilityObject; 317toolStrip.Items.Add(CreateSkippedItem()); 318toolStrip.Items.Add(string.Empty); 319toolStrip.Items.Add(CreateSkippedItem()); 320toolStrip.Items.Add(string.Empty); 321toolStrip.Items.Add(CreateSkippedItem()); 323toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 328AccessibleObject item2 = toolStrip.Items[1].AccessibilityObject; 329AccessibleObject item4 = toolStrip.Items[3].AccessibilityObject;
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (12)
133menuStrip.Items.Add(item1); 136Assert.Single(menuStrip.Items); 140menuStrip.Items.Add(separator); 143Assert.Equal(2, menuStrip.Items.Count); 148menuStrip.Items.Add(item2); 151Assert.Equal(3, menuStrip.Items.Count); 173menuStrip.Items.Add(item1); 176Assert.Single(menuStrip.Items); 180menuStrip.Items.Add(separator); 183Assert.Equal(2, menuStrip.Items.Count); 188menuStrip.Items.Add(item2); 191Assert.Equal(3, menuStrip.Items.Count);
System\Windows\Forms\AccessibleObjects\ToolStripOverflow.ToolStripOverflowAccessibleObjectTests.cs (7)
130AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 140toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 147AccessibleObject expected = toolStrip.Items[0].AccessibilityObject; 160AccessibleObject expected = toolStrip.Items[4].AccessibilityObject; 170toolStrip.Items[0].Alignment = ToolStripItemAlignment.Right; 177AccessibleObject expected = toolStrip.Items[4].AccessibilityObject; 207toolStrip.Items.Add(CreateItem(ToolStripItemAlignment.Left));
System\Windows\Forms\AccessibleObjects\ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObjectTests.cs (7)
84toolStrip.Items.Add(string.Empty); 85toolStrip.Items.Add(string.Empty); 86toolStrip.Items.Add(string.Empty); 110toolStrip.Items.Add(string.Empty); 111toolStrip.Items.Add(string.Empty); 112toolStrip.Items.Add(string.Empty); 117AccessibleObject item1 = toolStrip.Items[0].AccessibilityObject;
System\Windows\Forms\AccessibleObjects\ToolStripProgressBar.ToolStripProgressBarControl.ToolStripProgressBarControlAccessibleObjectTests.cs (3)
126toolStrip.Items.Add(label); 127toolStrip.Items.Add(item); 128toolStrip.Items.Add(button);
System\Windows\Forms\AccessibleObjects\ToolStripScrollButton.ToolStripScrollButtonAccessibleObjectTests.cs (8)
36toolStrip.Items.Add(ownerItem); 56AccessibleObject itemAccessibleObject1 = dropDownMenu.Items[0].AccessibilityObject; 57AccessibleObject itemAccessibleObject2 = dropDownMenu.Items[1].AccessibilityObject; 58AccessibleObject itemAccessibleObject3 = dropDownMenu.Items[2].AccessibilityObject; 98toolStrip.Items.Add(ownerItem); 117AccessibleObject itemAccessibleObject1 = dropDownMenu.Items[0].AccessibilityObject; 118AccessibleObject itemAccessibleObject2 = dropDownMenu.Items[1].AccessibilityObject; 136toolStrip.Items.Add(ownerItem);
System\Windows\Forms\AccessibleObjects\ToolStripSplitButton.ToolStripSplitButtonExAccessibleObjectTests.cs (2)
54toolStrip.Items.Add(toolStripSplitButton); 70toolStrip.Items.Add(toolStripSplitButton);
System\Windows\Forms\ControlTests.cs (8)
935toolStrip1.Items.AddRange((ToolStripItem[]) 945toolStrip2.Items.AddRange((ToolStripItem[]) 965Assert.True(toolStrip2.Items[0].Selected); 970Assert.True(toolStrip2.Items[0].Selected); 992toolStrip1.Items.AddRange((ToolStripItem[]) 1002toolStrip2.Items.AddRange((ToolStripItem[]) 1022Assert.True(toolStrip1.Items[0].Selected); 1027Assert.True(toolStrip1.Items[0].Selected);
System\Windows\Forms\FormTests.cs (2)
1254Assert.False(menuStrip.Items[0].Visible); 1261Assert.True(menuStrip.Items[0].Visible);
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (4)
1744control.Items.Add(itemWithDefaultName); 1745control.Items.Add(itemWithoutName); 1746control.Items.Add(itemWithNonStringName); 1747control.Items.Add(itemWithName);
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
173toolStrip.Items.Add(new ToolStripLabel("text"));
System\Windows\Forms\MdiControlStripTests.cs (3)
201menuStrip.Items.AddRange((ToolStripMenuItem[])[toolStripMenuItem1, toolStripMenuItem2]); 247menuStrip.Items.AddRange((ToolStripMenuItem[])[toolStripMenuItem1, toolStripMenuItem2]); 292menuStrip.Items.AddRange((ToolStripMenuItem[])[toolStripMenuItem1, toolStripMenuItem2]);
System\Windows\Forms\MenuStripTests.cs (3)
99Assert.Empty(control.Items); 100Assert.Same(control.Items, control.Items);
System\Windows\Forms\StatusStripTests.cs (11)
99Assert.Empty(control.Items); 100Assert.Same(control.Items, control.Items); 913Assert.Empty(control.Items); 928Assert.Empty(control.Items); 939Assert.Empty(control.Items); 966Assert.Empty(control.Items); 981Assert.Empty(control.Items); 992Assert.Empty(control.Items); 1034Assert.Empty(control.Items); 1045Assert.Empty(control.Items);
System\Windows\Forms\ToolStrip.ToolStripAccessibleObjectWrapperForItemsOnOverflowTests.cs (3)
29toolStrip.Items.Add(toolStripItem); 45toolStrip.Items.Add(toolStripItem); 77toolStrip.Items.Add(toolStripItem);
System\Windows\Forms\ToolStripButtonTests.Rendering.cs (6)
20toolStrip.Items.Add(toolStripButton); 46toolStrip.Items.Add(toolStripButton); 70toolStrip.Items.Add(toolStripButton); 96toolStrip.Items.Add(toolStripButton); 122toolStrip.Items.Add(toolStripDropDownButton); 149toolStrip.Items.Add(toolStripDropDownButton);
System\Windows\Forms\ToolStripControlHostTests.cs (45)
1399Assert.Empty(parent.Items); 1408Assert.Empty(parent.Items); 1410Assert.Empty(otherParent.Items); 1418Assert.Empty(parent.Items); 1420Assert.Empty(otherParent.Items); 1429Assert.Empty(parent.Items); 1430Assert.Empty(otherParent.Items); 1438Assert.Empty(parent.Items); 1440Assert.Empty(otherParent.Items); 1442Assert.Empty(statusParent.Items); 1468Assert.Same(item, Assert.Single(owner.Items)); 1470Assert.Empty(parent.Items); 1479Assert.Same(item, Assert.Single(owner.Items)); 1481Assert.Empty(parent.Items); 1483Assert.Empty(otherParent.Items); 1491Assert.Same(item, Assert.Single(owner.Items)); 1493Assert.Empty(parent.Items); 1495Assert.Empty(otherParent.Items); 1503Assert.Same(item, Assert.Single(owner.Items)); 1506Assert.Empty(parent.Items); 1507Assert.Empty(otherParent.Items); 1515Assert.Same(item, Assert.Single(owner.Items)); 1517Assert.Empty(parent.Items); 1519Assert.Empty(otherParent.Items); 1521Assert.Empty(statusParent.Items); 1538Assert.Empty(parent.Items); 3087Assert.Same(item, Assert.Single(owner.Items)); 3113Assert.Empty(parent.Items); 3122Assert.Empty(parent.Items); 3124Assert.Empty(otherParent.Items); 3133Assert.Empty(parent.Items); 3135Assert.Empty(otherParent.Items); 3144Assert.Empty(parent.Items); 3146Assert.Empty(otherParent.Items); 3155Assert.Empty(parent.Items); 3157Assert.Empty(otherParent.Items); 3186Assert.Empty(parent.Items); 3196Assert.Empty(parent.Items); 3198Assert.Empty(otherParent.Items); 3208Assert.Empty(parent.Items); 3210Assert.Empty(otherParent.Items); 3220Assert.Empty(parent.Items); 3222Assert.Empty(otherParent.Items); 3232Assert.Empty(parent.Items); 3234Assert.Empty(otherParent.Items);
System\Windows\Forms\ToolStripDropDownTests.cs (44)
105Assert.Empty(control.Items); 106Assert.Same(control.Items, control.Items); 1589control.Items.Add(item1); 1590control.Items.Add(item2); 1654control.Items.Add(child1); 1655control.Items.Add(child2); 3045Assert.Empty(control.Items); 3061Assert.Empty(control.Items); 3073Assert.Empty(control.Items); 3101Assert.Empty(control.Items); 3118Assert.Empty(control.Items); 3131Assert.Empty(control.Items); 3158Assert.Empty(control.Items); 3174Assert.Empty(control.Items); 3186Assert.Empty(control.Items); 3206control.Items.Add(item1); 3207control.Items.Add(item2); 3218Assert.Empty(control.Items); 3238Assert.Empty(control.Items); 3258Assert.Empty(control.Items); 3289Assert.Empty(control.Items); 3305Assert.Empty(control.Items); 3317Assert.Empty(control.Items); 3344Assert.Empty(control.Items); 3355Assert.Empty(control.Items); 3382Assert.Empty(control.Items); 3399Assert.Empty(control.Items); 3412Assert.Empty(control.Items); 3445Assert.Empty(control.Items); 3458Assert.Empty(control.Items); 3479control.Items.Add(item1); 3480control.Items.Add(item2); 3491Assert.Empty(control.Items); 3511Assert.Empty(control.Items); 3531Assert.Empty(control.Items); 3560control.Items.Add(item1); 3561control.Items.Add(item2); 3580Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 3599Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 4278control.Items.Add(item1); 4279control.Items.Add(item2); 4511control.Items.Add(item1); 4512control.Items.Add(item2);
System\Windows\Forms\ToolStripItemCollectionTests.cs (13)
112contextMenuStrip.Items.AddRange(toolStripDropDownButton.DropDownItems); 113Assert.Empty(contextMenuStrip.Items); 119contextMenuStrip.Items.AddRange(toolStripDropDownButton.DropDownItems); 120Assert.Equal(3, contextMenuStrip.Items.Count); 123Assert.Equal("a", contextMenuStrip.Items[0].Text); 124Assert.Equal("b", contextMenuStrip.Items[1].Text); 125Assert.Equal("c", contextMenuStrip.Items[2].Text); 293toolStrip1.Items.AddRange(items); 298toolStrip1.Items.Contains(items[0]).Should().BeFalse(); 299toolStrip1.Items.Contains(items[1]).Should().BeTrue(); 323toolStrip1.Items.AddRange(items); 328toolStrip1.Items.Contains(items[0]).Should().BeFalse(); 329toolStrip1.Items.Contains(items[1]).Should().BeTrue();
System\Windows\Forms\ToolStripItemRenderEventArgsTests.cs (1)
36toolStrip.Items.Add(toolStripItem);
System\Windows\Forms\ToolStripItemTests.cs (60)
395toolStrip.Items.Add(item); 6450Assert.Same(item, Assert.Single(owner.Items)); 6457Assert.Same(item, Assert.Single(owner.Items)); 6458Assert.Empty(otherOwner.Items); 6465Assert.Empty(owner.Items); 6466Assert.Same(item, Assert.Single(otherOwner.Items)); 6473Assert.Empty(owner.Items); 6474Assert.Empty(otherOwner.Items); 6481Assert.Empty(owner.Items); 6482Assert.Empty(otherOwner.Items); 6483Assert.Same(item, Assert.Single(statusOwner.Items)); 6500Assert.Same(item, Assert.Single(owner.Items)); 6507Assert.Same(item, Assert.Single(owner.Items)); 6508Assert.Empty(otherOwner.Items); 6515Assert.Empty(owner.Items); 6516Assert.Same(item, Assert.Single(otherOwner.Items)); 6523Assert.Empty(owner.Items); 6524Assert.Empty(otherOwner.Items); 6531Assert.Empty(owner.Items); 6532Assert.Empty(otherOwner.Items); 6533Assert.Same(item, Assert.Single(statusOwner.Items)); 6594Assert.Same(item, Assert.Single(owner.Items)); 6600Assert.Same(item, Assert.Single(owner.Items)); 6601Assert.Empty(otherOwner.Items); 6607Assert.Empty(owner.Items); 6608Assert.Same(item, Assert.Single(otherOwner.Items)); 6614Assert.Empty(owner.Items); 6615Assert.Empty(otherOwner.Items); 6622Assert.Same(item, Assert.Single(owner.Items)); 6623Assert.Empty(otherOwner.Items); 6977Assert.Empty(parent.Items); 6985Assert.Empty(parent.Items); 6986Assert.Empty(otherParent.Items); 6993Assert.Empty(parent.Items); 6994Assert.Empty(otherParent.Items); 7001Assert.Empty(parent.Items); 7002Assert.Empty(otherParent.Items); 7009Assert.Empty(parent.Items); 7010Assert.Empty(otherParent.Items); 7011Assert.Empty(statusParent.Items); 7034Assert.Empty(parent.Items); 7042Assert.Empty(parent.Items); 7043Assert.Empty(otherParent.Items); 7050Assert.Empty(parent.Items); 7051Assert.Empty(otherParent.Items); 7058Assert.Empty(parent.Items); 7059Assert.Empty(otherParent.Items); 7066Assert.Empty(parent.Items); 7067Assert.Empty(otherParent.Items); 7068Assert.Empty(statusParent.Items); 7078toolStrip.Items.Add(toolStripDropDownItem1); 9932Assert.Empty(owner.Items); 9940Assert.Empty(owner.Items); 9974Assert.Empty(parent.Items); 9982Assert.Empty(parent.Items); 10085Assert.Equal(!disposing, owner.Items.Contains(item)); 10093Assert.Equal(!disposing, owner.Items.Contains(item)); 10129Assert.Empty(parent.Items); 10137Assert.Empty(parent.Items); 15412menuStrip1.Items.AddRange(new ToolStripMenuItem[] { toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3 });
System\Windows\Forms\ToolStripRenderEventArgsTests.cs (1)
83owner.Items.Add(ownedDropDownItem);
System\Windows\Forms\ToolStripSplitStackDragDropHandlerTests.cs (3)
56_toolStrip.Items[0].Should().Be(toolStripItem); 67_toolStrip.Items.Count.Should().Be(0); 121_toolStrip.Items[0].Should().Be(newToolStripItem);
System\Windows\Forms\ToolStripTests.cs (83)
117Assert.Empty(control.Items); 118Assert.Same(control.Items, control.Items); 271Assert.NotSame(items, control.Items); 272Assert.Same(control.Items, control.Items); 273Assert.Equal(items, control.Items.Cast<ToolStripItem>()); 389control.Items.Add(item); 534control.Items.Add(item); 1505control.Items.Add(item1); 1506control.Items.Add(item2); 1570control.Items.Add(child1); 1571control.Items.Add(child2); 1631toolStrip1.Items.Add(item1); 1632toolStrip1.Items.Add(item2); 1651toolStrip1.Items.Add(item1); 1652toolStrip1.Items.Add(item2); 3478control.Items.Add(item1); 3479control.Items.Add(item2); 3508control.Items.Add(item1); 3509control.Items.Add(item2); 3609control.Items.Add(item); 3895control.Items.Add(item1); 3896control.Items.Add(item2); 3938control.Items.Add(item1); 3939control.Items.Add(item2); 3975control.Items.Add(item1); 3976control.Items.Add(item2); 4040control.Items.Add(item1); 4041control.Items.Add(item2); 4363Assert.Empty(control.Items); 4379Assert.Empty(control.Items); 4391Assert.Empty(control.Items); 4417Assert.Empty(control.Items); 4433Assert.Empty(control.Items); 4445Assert.Empty(control.Items); 4465control.Items.Add(item1); 4466control.Items.Add(item2); 4477Assert.Empty(control.Items); 4497Assert.Empty(control.Items); 4517Assert.Empty(control.Items); 4548Assert.Empty(control.Items); 4564Assert.Empty(control.Items); 4576Assert.Empty(control.Items); 4603Assert.Empty(control.Items); 4614Assert.Empty(control.Items); 4633control.Items.Add(item1); 4634control.Items.Add(item2); 4645Assert.Empty(control.Items); 4665Assert.Empty(control.Items); 4685Assert.Empty(control.Items); 4714control.Items.Add(item1); 4715control.Items.Add(item2); 4734Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 4753Assert.Equal(new ToolStripItem[] { item1, item2 }, control.Items.Cast<ToolStripItem>()); 4814toolStrip.Items.AddRange((ToolStripButton[])[toolStripButton1, toolStripButton2, toolStripButton3]); 4821ToolStripItem actual = toolStrip.GetNextItem(toolStrip.Items[0], ArrowDirection.Right); 4835toolStrip.Items.AddRange((ToolStripButton[])[toolStripButton1, toolStripButton2, toolStripButton3]); 4860toolStrip.Items.AddRange((ToolStripButton[])[toolStripButton1, toolStripButton2, toolStripButton3]); 4867ToolStripItem actual = toolStrip.GetNextItem(toolStrip.Items[0], ArrowDirection.Left); 4881toolStrip.Items.AddRange((ToolStripButton[])[toolStripButton1, toolStripButton2, toolStripButton3]); 5283control.Items.Add(item1); 5284control.Items.Add(item2); 5320control.Items.Add(item1); 5321control.Items.Add(item2); 5456control.Items.Add(item1); 5457control.Items.Add(item2); 5656control.Items.Add(item1); 5657control.Items.Add(item2); 5828toolStrip.Items.Add(item); 6406control.Items.Add(item1); 6407control.Items.Add(item2); 6459control.Items.Add(item1); 6460control.Items.Add(item2); 6697control.Items.Add(item1); 6698control.Items.Add(item2); 6742control.Items.Add(item1); 6743control.Items.Add(item2); 7295toolStrip.Items.AddRange((ToolStripItem[])[toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3]); 7299Assert.Equal(toolStrip.Items[2], previousToolStripItem1); 7302Assert.Equal(toolStrip.Items[0], previousToolStripItem2); 7312using ToolStripItem toolStripItem = menuStrip.Items.Add("toolStripItem"); 7333using ToolStripItem toolStripItem = menuStrip.Items.Add("toolStripItem");
System.Windows.Forms.UI.IntegrationTests (8)
Dpi\ToolStripItemTests.Dpi.cs (1)
41toolStrip.Items.Add(toolStripItemOpen);
DragDropTests.cs (3)
977ToolStrip.Items.Add(toolStripDropDownButton); 991_contextMenuStrip.Items.Clear(); 1004_contextMenuStrip.Items.Add(dragAcceptItem);
MenuStripTests.cs (1)
20menuStrip.Items.AddRange(toolStripMenuItem1);
ToolStripTests.cs (3)
41toolStrip.Items.Add(toolStripButton); 79menuStrip.Items.Add(menu1); 80menuStrip.Items.Add(hiddenMenu);
WinFormsControlsTest (24)
Dialogs.cs (2)
56toolbar.Items.Add(new ToolStripSeparator { Visible = true }); 57toolbar.Items.Add(_btnOpen);
DragDrop.cs (5)
456toolStrip.Items.Add(catToolStripDropDownButton); 469_catContextMenuStrip.Items.Clear(); 504_catContextMenuStrip.Items.Add(dragAcceptItem); 505_catContextMenuStrip.Items.Add(nyanCatItem); 506_catContextMenuStrip.Items.Add(asciiCatItem);
MdiChild.cs (2)
16_menuStrip.Items.Add(new ToolStripMenuItem { Text = "Child1" }); 17_menuStrip.Items.Add(new ToolStripMenuItem
MdiParent.cs (2)
31_menuStrip.Items.Add(menu); 40_menuStrip.Items.Add(item);
MenuStripAndCheckedListBox.Designer.cs (1)
67this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
MessageBoxes.cs (2)
42toolbar.Items.Add(new ToolStripSeparator { Visible = true }); 43toolbar.Items.Add(_btnOpen);
ToolStripSeparatorPreferredSize.cs (1)
42_toolStrip1.Items.AddRange((ToolStripItem[])
ToolStripTests.cs (4)
15toolStrip1.Items.Add(new ToolStripControlHost(new RadioButton() { Text = "RadioButton" })); // RadioButton supports UIA 16toolStrip1.Items.Add(new ToolStripControlHost(new HScrollBar() { Value = 30 })); // HScrollBar doesn't support UIA 17statusStrip1.Items.Add(new ToolStripControlHost(new RadioButton() { Text = "RadioButton" })); // RadioButton supports UIA 18statusStrip1.Items.Add(new ToolStripControlHost(new HScrollBar() { Value = 30 })); // HScrollBar doesn't support UIA
ToolStripTests.Designer.cs (5)
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[] { 378this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {