Implemented interface member:
2 overrides of Count
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (1)
22public override int Count => _realCollection.Count;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2160public override int Count => _realCollection.Count;
454 references to Count
System.Windows.Forms (330)
System\Windows\Forms\ContextMenuStrip.cs (1)
64for (int i = 0; i < Items.Count; i++)
System\Windows\Forms\Control.ControlCollection.ControlCollectionEnumerator.cs (2)
24_originalCount = controls.Count; 41if (_current < _controls.Count - 1 && _current < _originalCount - 1)
System\Windows\Forms\Control.ControlCollection.cs (11)
79for (int c = 0; c < (Count - 1); c++) 191for (int i = 0; i < controlsToLookIn.Count; i++) 207for (int i = 0; i < controlsToLookIn.Count; i++) 214if (controlsToLookIn[i].Controls.Count > 0) 255for (int i = 0; i < Count; i++) 274return ((index >= 0) && (index < Count)); 346ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count); 387while (Count != 0) 389RemoveAt(Count - 1); 430if (newIndex >= Count || newIndex == -1) 432newIndex = Count - 1;
System\Windows\Forms\Control.cs (35)
2240return controls is not null && controls.Count > 0; 3492for (int i = 0; i < controlsCollection.Count; i++) 4726Control[] controlSnapshot = new Control[controlsCollection.Count]; 4883for (int i = 0; i < controlsCollection.Count; i++) 4923for (int i = 0; i < controlsCollection.Count; i++) 5528List<ControlTabOrderHolder> holders = new(Controls.Count); 5561for (int c = 0; c < controls.Count; c++) 5573for (int c = controls.Count - 1; c >= 0; c--) 5645if (controls is not null && controls.Count > 0 && (ctl == this || !IsFocusManagingContainerControl(ctl))) 5670parentControlCount = parentControls.Count; 5728int siblingCount = siblings.Count; 5805while (children is not null && children.Count > 0 && (ctl == this || !IsFocusManagingContainerControl(ctl))) 6772for (int i = 0; i < controlsCollection.Count; i++) 6800for (int i = 0; i < controlsCollection.Count; i++) 6847for (int i = 0; i < controlsCollection.Count; i++) 6895for (int i = 0; i < controlsCollection.Count; i++) 6918for (int i = 0; i < controlsCollection.Count; i++) 6971for (int i = 0; i < controlsCollection.Count; i++) 7019for (int i = 0; i < controlsCollection.Count; i++) 7050for (int i = 0; i < controlsCollection.Count; i++) 7082for (int i = 0; i < controlsCollection.Count; i++) 7270for (int i = 0; i < controlsCollection.Count; i++) 7375for (int i = 0; i < controlsCollection.Count; i++) 7399for (int i = 0; i < controlsCollection.Count; i++) 7843for (int i = 0; i < controls.Count; i++) 8241for (int i = 0; i < controlsCollection.Count; i++) 8990int count = Controls.Count; 9014if (Controls.Count == 0) 9419if (controlsCollection is not null && controlsCollection.Count > 0) 9421controlSnapshot = new Control[controlsCollection.Count]; 9422for (int i = 0; i < controlsCollection.Count; i++) 9693for (int i = 0; i < controlsCollection.Count; i++) 9788for (int i = 0; i < controlsCollection.Count; i++) 9867for (int i = 0; i < controlsCollection.Count; i++) 10093for (int i = 0; i < controlsCollection.Count; i++)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (2)
413for (int i = 0; i < children.Count; i++) 436for (int i = 0; i < children.Count; i++)
System\Windows\Forms\Controls\DataGridView\DataGridView.ControlCollection.cs (1)
50for (int i = 0; i < Count; i++)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
6413Debug.Assert(_editingPanel is null || _editingPanel.Controls.Count == 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1111Debug.Assert(dataGridView.EditingPanel.Controls.Count == 0);
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
206if (DisplayedItems.Count > 0)
System\Windows\Forms\Controls\Splitter\Splitter.cs (2)
648int count = children.Count; 722int count = children.Count;
System\Windows\Forms\Controls\TabControl\TabPage.TabPageAccessibleObject.cs (2)
33if (index < 0 || index > owningTabPage.Controls.Count - 1) 44=> this.IsOwnerHandleCreated(out TabPage? owningTabPage) ? owningTabPage.Controls.Count : -1;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (9)
337int itemCount = DisplayedItems.Count; 350if (itemCount != DisplayedItems.Count || (item is not null && (inDisplayedItemCollection != DisplayedItems.Contains(item)))) 381for (int i = 0; i < Items.Count; i++) 468for (int i = 0; i < DisplayedItems.Count; i++) 496TableLayoutSettings.ColumnCount = DisplayedItems.Count + 1; // add an extra cell so it fills the remaining space 499for (int i = DisplayedItems.Count; i < TableLayoutSettings.ColumnStyles.Count; i++) 515for (int i = 0; i < DisplayedItems.Count; i++) 545TableLayoutSettings.RowCount = DisplayedItems.Count + 1; // add an extra cell so it fills the remaining space 548for (int i = DisplayedItems.Count; i < TableLayoutSettings.RowStyles.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (32)
971LayoutTransaction.DoLayoutIf((Items.Count > 0), this, this, PropertyNames.ImageScalingSize); 1779for (int i = 0; i < Items.Count; i++) 1873ToolStripItem[] displayedItems = new ToolStripItem[DisplayedItems.Count]; 1994for (int i = Items.Count - 1; i >= 0; i--) 2154if (DisplayedItems.Count <= 0) 2165start ??= forward ? DisplayedItems[DisplayedItems.Count - 1] : DisplayedItems[0]; 2173int count = DisplayedItems.Count; 2227for (int i = 0; i < DisplayedItems.Count; i++) 2363for (int j = 0; j < toolStrip.Items.Count; j++) 2384if (toolStrip.Items.Count == 0 || (!foundItemParticipatingInLayout)) 2422for (int j = 0; j < toolStrip.Items.Count; j++) 2443if (toolStrip.Items.Count == 0 || !foundItemParticipatingInLayout) 2488for (int i = 0; i < DisplayedItems.Count; i++) 2604for (int i = 0; i < Items.Count; i++) 2610Invalidate(Controls.Count > 0); 2626for (int j = 0; j < DisplayedItems.Count; j++) 3002for (int i = 0; i < DisplayedItems.Count; i++) 3006index = (index + 1) % DisplayedItems.Count; 3065for (int i = 0; i < DisplayedItems.Count; i++) 3068index = (index + 1) % DisplayedItems.Count; 3256for (int i = 0; i < Items.Count; i++) 3283for (int i = 0; i < Items.Count; i++) 3376for (int j = 0; j < Items.Count; j++) 3613for (int i = 0; i < DisplayedItems.Count; i++) 3728for (int i = 0; i < Items.Count; i++) 4000for (int i = 0; i < DisplayedItems.Count; i++) 4052if (toolStripItem is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.Count > 0) 4379for (; j >= 0 && j < Items.Count; j = (pass == 0) ? j + 1 : j - 1) 4428if (OverflowItems.Count == 0) 4445for (int j = 0; j < Items.Count; j++) 4590return $"{base.ToString()}, Name: {Name}, Items: {Items.Count}"; 4824int i = Items.Count;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (14)
57if (index < owner.Items.Count) 63for (int i = 0; i < owner.Items.Count; ++i) 80for (int i = 0; i < owner.Items.Count; ++i) 109if (owner.CanOverflow && owner.OverflowButton.Visible && index == owner.Items.Count) 129for (int i = 0; i < owner.Items.Count; i++) 164&& fragmentIndex == items.Count - 1) 169if (fragmentIndex < items.Count) 216for (int i = index + 1; i < items.Count; i++) 266return owner.OverflowItems.Count; 276return owner.DisplayedItems.Count; 312for (int index = 0; index < items.Count; index++) 344return owner.Items.Count + index; 348for (int i = 0; i < owner.Items.Count; ++i) 362for (int i = 0; i < owner.Items.Count; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1722CancelEventArgs openEventArgs = new(cancel: DisplayedItems.Count == 0);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
708if (_dropDown.IsAutoGenerated && DropDownItems.Count <= 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItemAccessibleObject.cs (3)
130for (int i = 0; i < _owner.DropDownItems.Count; i++) 153for (int i = 0; i < _owner.DropDownItems.Count; i++) 195if (index >= 0 && index < dropDown.DisplayedItems.Count)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (10)
282for (int i = 0; i < Items.Count; i++) 621if (Items.Count > 0) 644if (!RequiresScrollButtons || Items.Count == 0) 663for (int i = 0; i < Items.Count && deltaToScroll < requiredScrollAmount; ++i) 667Rectangle adjustedLastItemBounds = Items[Items.Count - 1].Bounds; 677if (i < Items.Count - 1) 690for (int i = Items.Count - 1; i >= 0 && deltaToScroll > requiredScrollAmount; --i) 734if (_indexOfFirstDisplayedItem == -1 || _indexOfFirstDisplayedItem >= Items.Count) 760if (_indexOfFirstDisplayedItem == Items.Count - 1) 821for (int i = 0; i < Items.Count; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
33for (int i = 0; i < _owner.Items.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
3602int i = 0, count = items.Count;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (10)
148for (int i = 0; i < toolStripItems.Count; i++) 170if (Count == 0) 186while (Count != 0) 188RemoveAt(Count - 1); 252for (int i = 0; i < itemsToLookIn.Count; i++) 268for (int j = 0; j < itemsToLookIn.Count; j++) 353for (int i = 0; i < Count; i++) 372return ((index >= 0) && (index < Count)); 429if (index < Count && index >= 0) 481if (index == Count)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (15)
992for (int i = 0; i < controlsToLookIn.Count; i++) 1006for (int i = 0; i < controlsToLookIn.Count; i++) 1013if ((controlsToLookIn[i].Controls is not null) && controlsToLookIn[i].Controls.Count > 0) 1038for (int i = 0; i < destinationItems.Count; i++) 1050if (result is null && source.MergeIndex > -1 && source.MergeIndex < destinationItems.Count) 1107int originalCount = sourceToolStrip.Items.Count; 1123int numberOfItemsMerged = lastCount - sourceToolStrip.Items.Count; 1125lastCount = sourceToolStrip.Items.Count; 1160if (item is ToolStripDropDownItem tsddownDest && source is ToolStripDropDownItem tsddownSrc && tsddownSrc.DropDownItems.Count != 0) 1162int originalCount = tsddownSrc.DropDownItems.Count; 1177int numberOfItemsMerged = lastCount - tsddownSrc.DropDownItems.Count; 1179lastCount = tsddownSrc.DropDownItems.Count; 1230int insertIndex = Math.Min(destinationItems.Count, source.MergeIndex); 1336historyItem.PreviousIndexCollection!.Insert(Math.Min(historyItem.PreviousIndex, historyItem.PreviousIndexCollection.Count), historyItem.TargetItem!); 1339historyItem.IndexCollection!.Insert(Math.Min(historyItem.Index, historyItem.IndexCollection.Count), historyItem.TargetItem!);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (1)
105int sizeOfSet = displayedItems.Count;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
135for (int j = 0; j < DisplayedItems.Count; j++)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.ToolStripOverflowAccessibleObject.cs (2)
17=> this.TryGetOwnerAs(out ToolStripOverflow? owner) && (index >= 0 || index < owner.DisplayedItems.Count) 25? owner.DisplayedItems.Count
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
45public override bool HasDropDownItems => ParentInternal is not null && ParentInternal.OverflowItems.Count > 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (16)
293ToolStripPanelRow[] rows = new ToolStripPanelRow[RowsInternal.Count]; 520if (Controls.Count > 0) 524Control[] controls = new Control[Controls.Count]; 525Point[] controlLocations = new Point[Controls.Count]; 618if (controls is not null && controls.Count > 0) 623Control[] controlArray = new Control[controls.Count]; 627int numRows = RowsInternal.Count; 660if (numRows < RowsInternal.Count || forceLayout) 730if (row >= RowsInternal.Count) 867int index = RowsInternal.Count; 882if (RowsInternal.Count > 0) 895&& previousRow.ControlsInternal.Count == 1 921if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.Count == 1) 939if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.Count > 1) 957for (int i = 0; i < RowsInternal.Count; i++) 1058for (int i = 0; i < RowsInternal.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (4)
77int currentCount = value.Count; 100while (Count != 0) 102RemoveAt(Count - 1); 156if (index < Count && index >= 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
307if (ToolStripPanelRow.Cells[ToolStripPanelRow.Cells.Count - 1] == this)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (21)
76Control[] controls = new Control[ControlsInternal.Count]; 346if (ControlsInternal.Count <= 0) 368for (int i = 0; i < Cells.Count; i++) 400ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.Count - 1, forward: false); 423ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.Count - 1, forward: false); 444int[] margins = new int[Cells.Count]; 445for (int i = 0; i < Cells.Count; i++) 454for (int i = 0; i < Cells.Count; i++) 470for (int i = Cells.Count - 1; i >= 0; i--) 486for (int j = i + 1; j < Cells.Count; j++) 488cellOffsets ??= new int[Cells.Count]; 506for (int i = 0; i < Cells.Count; i++) 520ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.Count - 1, forward: false); 541int[] margins = new int[Cells.Count]; 542for (int i = 0; i < Cells.Count; i++) 551for (int i = 0; i < Cells.Count; i++) 567for (int i = Cells.Count - 1; i >= 0; i--) 583for (int j = i + 1; j < Cells.Count; j++) 585cellOffsets ??= new int[Cells.Count]; 603for (int i = 0; i < Cells.Count; i++) 731if (ControlsInternal.Count == 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (21)
63if (index < ToolStripPanel.RowsInternal.Count - 1) 86for (int i = 0; i < Row.ControlsInternal.Count; i++) 107ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 133spaceToFree -= MoveLeft(Row.Cells.Count - 1, spaceToFree); 211if (index + 1 < Row.Cells.Count) 240if (spaceToFree == 0 || index < 0 || index >= Row.ControlsInternal.Count) 249for (int i = index + 1; i < Row.Cells.Count; i++) 281if (Row.Cells.Count > 0 && (spaceToFree > freedSpace)) 283ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 314for (int i = index + 1; i < Row.Cells.Count; i++) 331if (Row.Cells.Count == 1) 358if (index < Row.ControlsInternal.Count - 1 /*not the last one in the row*/) 401if (Row.ControlsInternal.Count > 0) 404for (index = 0; index < Row.Cells.Count; index++) 428if (index < Row.ControlsInternal.Count) 454if (index < Row.ControlsInternal.Count - 1) 489ToolStripPanelCell? nextCell = GetNextVisibleCell(Row.Cells.Count - 2, forward: false); 490ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 531if (Row.Cells.Count > 0 || toolStripToDrag.IsInDesignMode) 534ToolStripPanelCell? cell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 537cell = (ToolStripPanelCell)Row.Cells[Row.Cells.Count - 1];
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (7)
111for (int i = 0; i < Count; i++) 131while (Count != 0) 133RemoveAt(Count - 1); 149if (index < Count && index >= 0) 160for (int i = 0; i < Count; i++) 192for (int i = 0; i < Count; i++) 273if (index >= 0 && index < Count)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowManager.cs (3)
72if (index >= 0 && index < Row.ControlsInternal.Count - 1) 88for (int i = index; i < Row.Cells.Count; i++) 126for (int i = index + 1; i < Row.ControlsInternal.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (24)
64if (index < ToolStripPanel.RowsInternal.Count - 1) 88for (int i = 0; i < Row.ControlsInternal.Count; i++) 109ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 135spaceToFree -= MoveUp(Row.Cells.Count - 1, spaceToFree); 213if (index + 1 < Row.Cells.Count) 242if (spaceToFree == 0 || index < 0 || index >= Row.ControlsInternal.Count) 251for (int i = index + 1; i < Row.Cells.Count; i++) 283if (Row.Cells.Count > 0 && (spaceToFree > freedSpace)) 285ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 309for (int i = index + 1; i < Row.Cells.Count; i++) 326if (Row.Cells.Count == 1) 351if (Row.Cells.Count > 0) 355ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 361ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 384MoveUp(Row.Cells.Count - 1, spaceToFree); 407if (Row.ControlsInternal.Count > 0) 410for (index = 0; index < Row.Cells.Count; index++) 434if (index < Row.ControlsInternal.Count) 461if (index < Row.ControlsInternal.Count - 1) 499ToolStripPanelCell? nextCell = GetNextVisibleCell(Row.Cells.Count - 2, forward: false); 500ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 541if (Row.Cells.Count > 0) 543ToolStripPanelCell? cell = GetNextVisibleCell(Row.Cells.Count - 1, forward: false); 568if (index < Row.ControlsInternal.Count - 1 /*not the last one in the row*/)
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.StickyLabelAccessibleObject.cs (2)
31=> _owner.UpDirection && toolStripDropDownMenu.Items.Count > 0 35=> !_owner.UpDirection && toolStripDropDownMenu.Items.Count > 0
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (9)
74if (toolStrip.Items.Count == 0) 79StringBuilder itemNames = new(toolStrip.Items.Count); 81for (int i = 0; i < toolStrip.Items.Count; i++) 192for (int i = 0; ((i < toolStrip.Items.Count) && (i < keys.Length)); i++) 239for (int i = 0; i < controlsToLookIn.Count; i++) 255for (int i = 0; i < controlsToLookIn.Count; i++) 262if ((controlsToLookIn[i].Controls is not null) && controlsToLookIn[i].Controls.Count > 0) 289for (int i = 0; i < controlsCollection.Count; i++) 302for (int i = 0; i < controlsCollection.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonExAccessibleObject.cs (2)
82NavigateDirection.NavigateDirection_LastChild => DropDownItemsCount > 0 ? _owningToolStripSplitButton.DropDown.Items[_owningToolStripSplitButton.DropDown.Items.Count - 1].AccessibilityObject : null, 98return _owningToolStripSplitButton.DropDownItems.Count;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (6)
124else if (toolStripItemIndex == -1 && _owner.Items.Count == 0) 159else if (_owner.Items.Count == 0) 172for (int i = 0; i < _owner.DisplayedItems.Count; i++) 183if (_owner.DisplayedItems.Count > 0) 185for (int i = 0; i < _owner.DisplayedItems.Count; i++) 198return _owner.Items.IndexOf(_owner.DisplayedItems[_owner.DisplayedItems.Count - 1]);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (7)
67for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < toolStrip.Items.Count; ForwardsWalkingIndex++) 117for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < ToolStrip.Items.Count; ForwardsWalkingIndex++) 239for (int j = -1; j < toolStrip.Items.Count; j++) 381for (int j = -1; j < ToolStrip.Items.Count; j++) 523for (int i = 0; i < toolStrip.Items.Count; i++) 547for (int i = 0; i < toolStrip.Items.Count; i++) 567BackwardsWalkingIndex = (backIndex == -1) ? ToolStrip.Items.Count - 1 : backIndex - 1;
System\Windows\Forms\Form.cs (5)
4015if (Controls.Count > 1) 4017for (int index = 0; index < Controls.Count; index++) 6458numWindowListItems = MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count; 6468Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count, "Calling RevertMerge modified the mdiwindowlistitem"); 6515int nSubItems = sourceMenuStrip.MdiWindowListItem.DropDownItems.Count;
System\Windows\Forms\Layout\ArrangedElementCollection.cs (3)
26if (obj is not ArrangedElementCollection other || Count != other.Count) 31for (int i = 0; i < Count; i++)
System\Windows\Forms\Layout\CommonProperties.cs (1)
369for (int i = 0; i < controlsCollection.Count; i++)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (4)
1044for (int i = 0; i < controlsCollection.Count; i++) 1064for (int i = 0; i < controlsCollection.Count; i++) 1256if (Controls.Count == 0) 1976int count = children.Count;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1794if ((Panel1.Controls.Count > 0 || Panel2.Controls.Count > 0) || TabStop)
System\Windows\Forms\Layout\DefaultLayout.cs (7)
27for (int i = children.Count - 1; i >= 0; i--) 361for (int i = children.Count - 1; i >= 0; i--) 388for (int i = children.Count - 1; i >= 0; i--) 605if (!measureOnly && children.Count == 0) 613for (int i = children.Count - 1; i >= 0; i--) 699for (int i = 0; i < controls.Count; i++) 1128for (int i = children.Count - 1; i >= 0; i--)
System\Windows\Forms\Layout\FlowLayout.cs (5)
74for (int i = 0; i < container.Children.Count;) 81Debug.Assert(wrapContents || breakIndex == container.Children.Count, 99if (container.Children.Count != 0 && !measureOnly) 146endIndex: containerProxy.Container.Children.Count, 336for (int i = 1; i < collection.Count; i++)
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (2)
237LayoutInfo[] childInfo = new LayoutInfo[children.Count]; 240for (int i = 0; i < children.Count; i++)
System\Windows\Forms\Layout\TableLayout.cs (6)
1299if (children is null || children.Count == 0) 1311for (int i = 0; i < children.Count; i++) 1335if (children is null || children.Count == 0) 1398List<LayoutInfo> childrenInfo = new(children.Count); 1402for (int i = 0; i < children.Count; i++) 1459List<LayoutInfo> layoutInfos = new(container.Children.Count);
System\Windows\Forms\MDI\MDIClient.cs (1)
243for (int i = 0; i < Controls.Count; i++)
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
97Debug.Assert(Items.Count <= 4, "Too many items in the MDIControlStrip. How did we get into this situation?");
System\Windows\Forms\Panels\Panel.PanelAccessibleObject.cs (2)
24!this.IsOwnerHandleCreated(out Panel? owner) || index < 0 || index >= owner.Controls.Count 31=> this.IsOwnerHandleCreated(out Panel? owner) ? owner.Controls.Count : -1;
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (1)
172return collection is not null && collection.Count > 0;
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (1)
497List<ControlInformation> controlsInfo = new(Owner!.Children.Count);
System\Windows\Forms\Scrolling\ScrollableControl.cs (5)
335if (Controls.Count != 0) 347for (int i = 0; i < Controls.Count; i++) 400else if (Controls.Count != 0) 403for (int i = 0; i < Controls.Count; i++) 809for (int i = 0; i < Controls.Count; i++)
System.Windows.Forms.Design (88)
System\ComponentModel\Design\ToolStripContainerActionList.cs (3)
103&& root.Controls.Count > 1; 137|| root.Controls.Count <= 1) 152Control[] childControls = new Control[root.Controls.Count];
System\Drawing\Design\ColorEditor.ColorUI.ColorEditorTabControl.cs (1)
21if (selectedTab is not null && selectedTab.Controls.Count > 0)
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
325if (selectedPage is not null && selectedPage.Controls.Count > 0)
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (3)
434nextTabIndex = Controls.Count - 1; 436else if (nextTabIndex >= Controls.Count) 441for (int i = 0; i < Controls.Count; i++)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (2)
402numberOfOriginalTrayControls = tray is not null ? tray.Controls.Count : 0; 528int numberOfTrayControlsAdded = tray.Controls.Count - numberOfOriginalTrayControls;
System\Windows\Forms\Design\CommandSet.cs (3)
1786if (controlCommonParent.Controls.Count > 0) 1855int numberOfOriginalTrayControls = tray is not null ? tray.Controls.Count : 0; 2135int numberOfTrayControlsAdded = tray.Controls.Count - numberOfOriginalTrayControls;
System\Windows\Forms\Design\ComponentTray.cs (3)
227for (int i = 0; i < children.Count; ++i) 444get => Controls.Count; 1377int controlCount = Controls.Count;
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (2)
299for (int i = 0; i < parent.Controls.Count; i++) 404for (int i = control.Controls.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\ControlCommandSet.cs (8)
1142if (_baseControl is not null && _baseControl.Controls.Count > 0) 1392if (current.Controls.Count > 0) 1511if (ctlControls is not null && ctlControls.Count > 0) 1517for (int c = 0; c < ctlControls.Count; c++) 1545parentControlCount = parentControls.Count; 1613parentControlCount = parentControls.Count; 1679while (ctlControls is not null && ctlControls.Count > 0) 1686for (int c = ctlControls.Count - 1; c >= 0; c--)
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (2)
22public override int Count => _realCollection.Count; 70for (int i = _realCollection.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\DesignerFrame.cs (1)
318List<ThemedScrollbarWindow> windows = new(Controls.Count);
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (5)
171if (children.Count == 0) 178_childInfo = new ChildInfo[children.Count]; 197for (i = 0; i < children.Count; i++) 658_insertionIndex = children.Count; 886_insertionIndex = FlowLayoutPanel.Controls.Count;
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (2)
54if (Items.Count > 0 && items.Count > 0) 80e.Cancel = (Items.Count == 0);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
608Control[] children = new Control[parent.Controls.Count]; 869int controlCount = control.Controls.Count;
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
132if (_splitterPanel.Controls.Count == 0) 211if (_splitterPanel.Controls.Count == 0)
System\Windows\Forms\Design\TabControlDesigner.cs (2)
75_removeVerb.Enabled = Control.Controls.Count > 0; 118_removeVerb.Enabled = Control.Controls.Count > 0;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (3)
1181for (int i = 0; i < Control.Controls.Count; i++) 2160public override int Count => _realCollection.Count; 2215for (int i = _realCollection.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\TabOrder.cs (3)
361for (int n = 0; n < ctl.Controls.Count; n++) 420int count = control.Controls.Count; 430if (ctlTab.Controls.Count > 0)
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (1)
18if (toolStrip.Items.Count == 0)
System\Windows\Forms\Design\ToolStripDesigner.cs (8)
911int count = ToolStrip.Items.Count; 1062if (ToolStrip.Items.Count > 1) 1064itemIndex = Math.Min(ToolStrip.Items.Count - 1, itemIndex); 1281if (ToolStrip.Items.Count > 0) 1283ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.Count]; 1553index = parent.Controls.Count - 1; 1583index = parent.Controls.Count; 1978if (currentIndexOfEditor == -1 || currentIndexOfEditor != ToolStrip.Items.Count - 1)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (3)
626int count = _dropDown.Items.Count - 1; 667if (_dropDown.Items.Count > 0) 669ToolStripItem[] items = new ToolStripItem[_dropDown.Items.Count];
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
540if (item is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.Count > 1 /*including TN*/) 562if (item is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.Count > 1 /*including TN*/)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (10)
336parentControlCount = parentControls.Count; 391parentControlCount = parentControls.Count; 699int count = parent.Items.Count; 744int count = parent.Items.Count; 1720next = current.Controls.Count > 0 ? current.Controls[0] : (object)current; 1846targetSelection = !backwards ? collection[0] : (object)collection[wb.Items.Count - 1]; 1987targetSelection = collection.Count >= 2 ? collection[collection.Count - 2] : GetNextControlInTab(baseCtl, parent, !backwards); 2042object[] totalObjects = new object[parent.Items.Count - 1]; 2043for (int i = 0; i < parent.Items.Count - 1; i++)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (12)
135if (MenuItem.DropDown.IsAutoGenerated && MenuItem.DropDownItems.Count > 0) 154ToolStripItem[] items = new ToolStripItem[MenuItem.DropDownItems.Count]; 711if (MenuItem.DropDownItems.Count == 0) 967if (index != -1 && MenuItem.DropDownItems.Count > index) 1176if (ddi.DropDown.Site is not null || ddi.DropDownItems.Count == 1) 1403for (int i = 0; i < wb.Items.Count; i++) 1709int count = MenuItem.DropDownItems.Count; 1923if (ownerItem.DropDownItems.Count > 1) 1925itemIndex = Math.Min(ownerItem.DropDownItems.Count - 1, itemIndex); 2050if (currentIndexOfEditor >= 0 && currentIndexOfEditor < MenuItem.DropDown.Items.Count - 1) 2333if (ownerItem.DropDownItems.Count > 0 && ownerItem.DropDownItems[0] is DesignerToolStripControlHost) 2462count = MenuItem.DropDownItems.Count;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
391if (Control.Controls.Count == 0)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (3)
1439if (_addItemButton.DropDownItems.Count > 0) 1451Debug.Assert(_addItemButton.DropDownItems.Count > 0); 1667for (int i = 0; i < Items.Count; i++)
System.Windows.Forms.Design.Tests (3)
System\Windows\Forms\Design\GroupedContextMenuStripTests.cs (3)
12groupedContextMenuStrip.Items.Count.Should().Be(0); 25groupedContextMenuStrip.Items.Count.Should().Be(1); 41groupedContextMenuStrip.Items.Count.Should().Be(3);
System.Windows.Forms.Tests (32)
BindingNavigatorTests.cs (1)
113Assert.Equal(11, bn.Items.Count);
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (6)
136Assert.Equal(1, menuStrip.Items.Count); 143Assert.Equal(2, menuStrip.Items.Count); 151Assert.Equal(3, menuStrip.Items.Count); 176Assert.Equal(1, menuStrip.Items.Count); 183Assert.Equal(2, menuStrip.Items.Count); 191Assert.Equal(3, menuStrip.Items.Count);
System\Windows\Forms\MdiControlStripTests.cs (1)
66Assert.Equal(2, mdiControlStrip.DisplayedItems.Count);
System\Windows\Forms\PropertyGridTests.cs (1)
73Assert.Equal(4, control.Controls.Count);
System\Windows\Forms\StatusStripTests.cs (5)
743Assert.Equal(expectedChildrenCallCount1, control.Controls.Count); 749Assert.Equal(expectedChildrenCallCount1, control.Controls.Count); 755Assert.Equal(expectedChildrenCallCount2, control.Controls.Count); 1033Assert.Equal(expectedChildrenCallCount1, control.Controls.Count); 1044Assert.Equal(expectedChildrenCallCount1, control.Controls.Count);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
4891for (int i = 1; i < items.Count; i++) // it needs for correct work of ToolStrip.GetNextItemVertical method
System\Windows\Forms\ToolStripItemCollectionTests.cs (2)
109Assert.Equal(0, contextMenuStrip.Items.Count); 116Assert.Equal(3, contextMenuStrip.Items.Count);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
250item.DropDownItems.Count.Should().Be(2);
System\Windows\Forms\ToolStripPanel.ToolStripPanelRowCollectionTests.cs (10)
52toolStripPanelRowCollection.Count.Should().Be(1); 62_toolStripPanelRowCollection.Count.Should().Be(2); 80_toolStripPanelRowCollection.Count.Should().Be(1); 116_toolStripPanelRowCollection.Count.Should().Be(4); 142_toolStripPanelRowCollection.Count.Should().Be(2); 146_toolStripPanelRowCollection.Count.Should().Be(0); 159_toolStripPanelRowCollection.Count.Should().Be(0); 172_toolStripPanelRowCollection.Count.Should().Be(0); 191_toolStripPanelRowCollection.Count.Should().Be(1); 211_toolStripPanelRowCollection.Count.Should().Be(1);
System\Windows\Forms\ToolStripSplitStackDragDropHandlerTests.cs (1)
67_toolStrip.Items.Count.Should().Be(0);
System\Windows\Forms\ToolStripTests.cs (2)
7356while (listToolStripMenuItem.DropDownItems.Count > 0) 7357listToolStripMenuItem.DropDownItems[listToolStripMenuItem.DropDownItems.Count - 1].Dispose();
ToolStripContainerTests.cs (1)
37_toolStripContainer.Controls.Count.Should().Be(5);
WinFormsControlsTest (1)
MainForm.cs (1)
295(int)Math.Ceiling((overarchingFlowLayoutPanel.Controls.Count + 1) / 3.0) * (biggestButton.Height + padding * 2)