Implemented interface member:
2 overrides of Count
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (1)
22
public override int
Count
=> _realCollection.Count;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2153
public override int
Count
=> _realCollection.Count;
455 references to Count
System.Windows.Forms (329)
System\Windows\Forms\ContextMenuStrip.cs (1)
64
for (int i = 0; i < Items.
Count
; i++)
System\Windows\Forms\Control.ControlCollection.ControlCollectionEnumerator.cs (2)
24
_originalCount = controls.
Count
;
41
if (_current < _controls.
Count
- 1 && _current < _originalCount - 1)
System\Windows\Forms\Control.ControlCollection.cs (11)
79
for (int c = 0; c < (
Count
- 1); c++)
191
for (int i = 0; i < controlsToLookIn.
Count
; i++)
207
for (int i = 0; i < controlsToLookIn.
Count
; i++)
214
if (controlsToLookIn[i].Controls.
Count
> 0)
255
for (int i = 0; i <
Count
; i++)
274
return ((index >= 0) && (index <
Count
));
346
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
Count
);
387
while (
Count
!= 0)
389
RemoveAt(
Count
- 1);
430
if (newIndex >=
Count
|| newIndex == -1)
432
newIndex =
Count
- 1;
System\Windows\Forms\Control.cs (35)
2145
public bool HasChildren => ChildControls is not null && ChildControls.
Count
> 0;
3362
for (int i = 0; i < children.
Count
; i++)
4583
Control[] controlSnapshot = new Control[children.
Count
];
4741
for (int i = 0; i < children.
Count
; i++)
4776
for (int i = 0; i < children.
Count
; i++)
5408
List<ControlTabOrderHolder> holders = new(Controls.
Count
);
5439
for (int c = 0; c < children.
Count
; c++)
5451
for (int c = children.
Count
- 1; c >= 0; c--)
5521
if (ChildControls is { } children && children.
Count
> 0 && (ctl == this || !IsFocusManagingContainerControl(ctl)))
5546
parentChildCount = parentChildren.
Count
;
5604
int siblingCount = siblings.
Count
;
5676
while (children is not null && children.
Count
> 0 && (ctl == this || !IsFocusManagingContainerControl(ctl)))
6603
for (int i = 0; i < children.
Count
; i++)
6627
for (int i = 0; i < children.
Count
; i++)
6670
for (int i = 0; i < children.
Count
; i++)
6714
for (int i = 0; i < children.
Count
; i++)
6736
for (int i = 0; i < children.
Count
; i++)
6785
for (int i = 0; i < children.
Count
; i++)
6829
for (int i = 0; i < children.
Count
; i++)
6856
for (int i = 0; i < children.
Count
; i++)
6884
for (int i = 0; i < children.
Count
; i++)
7069
for (int i = 0; i < children.
Count
; i++)
7169
for (int i = 0; i < children.
Count
; i++)
7189
for (int i = 0; i < children.
Count
; i++)
7623
for (int i = 0; i < children.
Count
; i++)
8017
for (int i = 0; i < children.
Count
; i++)
8765
int count = Controls.
Count
;
8789
if (Controls.
Count
== 0)
9178
if (ChildControls is { } children && children.
Count
> 0)
9180
controlSnapshot = new Control[children.
Count
];
9181
for (int i = 0; i < children.
Count
; i++)
9446
for (int i = 0; i < children.
Count
; i++)
9535
for (int i = 0; i < children.
Count
; i++)
9608
for (int i = 0; i < children.
Count
; i++)
9819
for (int i = 0; i < children.
Count
; i++)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (2)
413
for (int i = 0; i < children.
Count
; i++)
436
for (int i = 0; i < children.
Count
; i++)
System\Windows\Forms\Controls\DataGridView\DataGridView.ControlCollection.cs (1)
50
for (int i = 0; i <
Count
; i++)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
6240
Debug.Assert(_editingPanel is null || _editingPanel.Controls.
Count
== 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1095
Debug.Assert(dataGridView.EditingPanel.Controls.
Count
== 0);
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
206
if (DisplayedItems.
Count
> 0)
System\Windows\Forms\Controls\Splitter\Splitter.cs (2)
648
int count = children.
Count
;
722
int count = children.
Count
;
System\Windows\Forms\Controls\TabControl\TabPage.TabPageAccessibleObject.cs (2)
33
if (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)
337
int itemCount = DisplayedItems.
Count
;
350
if (itemCount != DisplayedItems.
Count
|| (item is not null && (inDisplayedItemCollection != DisplayedItems.Contains(item))))
381
for (int i = 0; i < Items.
Count
; i++)
468
for (int i = 0; i < DisplayedItems.
Count
; i++)
496
TableLayoutSettings.ColumnCount = DisplayedItems.
Count
+ 1; // add an extra cell so it fills the remaining space
499
for (int i = DisplayedItems.
Count
; i < TableLayoutSettings.ColumnStyles.Count; i++)
515
for (int i = 0; i < DisplayedItems.
Count
; i++)
545
TableLayoutSettings.RowCount = DisplayedItems.
Count
+ 1; // add an extra cell so it fills the remaining space
548
for (int i = DisplayedItems.
Count
; i < TableLayoutSettings.RowStyles.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (32)
933
LayoutTransaction.DoLayoutIf((Items.
Count
> 0), this, this, PropertyNames.ImageScalingSize);
1710
for (int i = 0; i < Items.
Count
; i++)
1787
ToolStripItem[] displayedItems = new ToolStripItem[DisplayedItems.
Count
];
1912
for (int i = Items.
Count
- 1; i >= 0; i--)
2070
if (DisplayedItems.
Count
<= 0)
2081
start ??= forward ? DisplayedItems[DisplayedItems.
Count
- 1] : DisplayedItems[0];
2089
int count = DisplayedItems.
Count
;
2143
for (int i = 0; i < DisplayedItems.
Count
; i++)
2279
for (int j = 0; j < toolStrip.Items.
Count
; j++)
2300
if (toolStrip.Items.
Count
== 0 || (!foundItemParticipatingInLayout))
2338
for (int j = 0; j < toolStrip.Items.
Count
; j++)
2359
if (toolStrip.Items.
Count
== 0 || !foundItemParticipatingInLayout)
2404
for (int i = 0; i < DisplayedItems.
Count
; i++)
2520
for (int i = 0; i < Items.
Count
; i++)
2526
Invalidate(Controls.
Count
> 0);
2542
for (int j = 0; j < DisplayedItems.
Count
; j++)
2888
for (int i = 0; i < DisplayedItems.
Count
; i++)
2892
index = (index + 1) % DisplayedItems.
Count
;
2951
for (int i = 0; i < DisplayedItems.
Count
; i++)
2954
index = (index + 1) % DisplayedItems.
Count
;
3142
for (int i = 0; i < Items.
Count
; i++)
3169
for (int i = 0; i < Items.
Count
; i++)
3262
for (int j = 0; j < Items.
Count
; j++)
3499
for (int i = 0; i < DisplayedItems.
Count
; i++)
3615
for (int i = 0; i < Items.
Count
; i++)
3887
for (int i = 0; i < DisplayedItems.
Count
; i++)
3939
if (toolStripItem is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.
Count
> 0)
4268
for (; j >= 0 && j < Items.
Count
; j = (pass == 0) ? j + 1 : j - 1)
4317
if (OverflowItems.
Count
== 0)
4334
for (int j = 0; j < Items.
Count
; j++)
4479
return $"{base.ToString()}, Name: {Name}, Items: {Items.
Count
}";
4705
int i = Items.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (14)
56
if (index < owner.Items.
Count
)
62
for (int i = 0; i < owner.Items.
Count
; ++i)
79
for (int i = 0; i < owner.Items.
Count
; ++i)
108
if (owner.CanOverflow && owner.OverflowButton.Visible && index == owner.Items.
Count
)
128
for (int i = 0; i < owner.Items.
Count
; i++)
163
&& fragmentIndex == items.
Count
- 1)
168
if (fragmentIndex < items.
Count
)
215
for (int i = index + 1; i < items.
Count
; i++)
265
return owner.OverflowItems.
Count
;
275
return owner.DisplayedItems.
Count
;
311
for (int index = 0; index < items.
Count
; index++)
343
return owner.Items.
Count
+ index;
347
for (int i = 0; i < owner.Items.
Count
; ++i)
361
for (int i = 0; i < owner.Items.
Count
; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1589
CancelEventArgs openEventArgs = new(cancel: DisplayedItems.
Count
== 0);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
708
if (_dropDown.IsAutoGenerated && DropDownItems.
Count
<= 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItemAccessibleObject.cs (3)
130
for (int i = 0; i < _owner.DropDownItems.
Count
; i++)
153
for (int i = 0; i < _owner.DropDownItems.
Count
; i++)
195
if (index >= 0 && index < dropDown.DisplayedItems.
Count
)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (10)
282
for (int i = 0; i < Items.
Count
; i++)
617
if (Items.
Count
> 0)
640
if (!RequiresScrollButtons || Items.
Count
== 0)
659
for (int i = 0; i < Items.
Count
&& deltaToScroll < requiredScrollAmount; ++i)
663
Rectangle adjustedLastItemBounds = Items[Items.
Count
- 1].Bounds;
673
if (i < Items.
Count
- 1)
686
for (int i = Items.
Count
- 1; i >= 0 && deltaToScroll > requiredScrollAmount; --i)
730
if (_indexOfFirstDisplayedItem == -1 || _indexOfFirstDisplayedItem >= Items.
Count
)
756
if (_indexOfFirstDisplayedItem == Items.
Count
- 1)
816
for (int i = 0; i < Items.
Count
; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
32
for (int i = 0; i < _owner.Items.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
3551
int i = 0, count = items.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (10)
145
if (toolStripItems.
Count
== 0)
177
if (
Count
== 0)
193
while (
Count
!= 0)
195
RemoveAt(
Count
- 1);
259
for (int i = 0; i < itemsToLookIn.
Count
; i++)
275
for (int j = 0; j < itemsToLookIn.
Count
; j++)
360
for (int i = 0; i <
Count
; i++)
379
return ((index >= 0) && (index <
Count
));
435
ToolStripItem item = index >=
Count
|| index < 0
482
if (index ==
Count
)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (15)
992
for (int i = 0; i < controlsToLookIn.
Count
; i++)
1006
for (int i = 0; i < controlsToLookIn.
Count
; i++)
1013
if ((controlsToLookIn[i].Controls is not null) && controlsToLookIn[i].Controls.
Count
> 0)
1038
for (int i = 0; i < destinationItems.
Count
; i++)
1050
if (result is null && source.MergeIndex > -1 && source.MergeIndex < destinationItems.
Count
)
1107
int originalCount = sourceToolStrip.Items.
Count
;
1123
int numberOfItemsMerged = lastCount - sourceToolStrip.Items.
Count
;
1125
lastCount = sourceToolStrip.Items.
Count
;
1160
if (item is ToolStripDropDownItem tsddownDest && source is ToolStripDropDownItem tsddownSrc && tsddownSrc.DropDownItems.
Count
!= 0)
1162
int originalCount = tsddownSrc.DropDownItems.
Count
;
1177
int numberOfItemsMerged = lastCount - tsddownSrc.DropDownItems.
Count
;
1179
lastCount = tsddownSrc.DropDownItems.
Count
;
1230
int insertIndex = Math.Min(destinationItems.
Count
, source.MergeIndex);
1336
historyItem.PreviousIndexCollection!.Insert(Math.Min(historyItem.PreviousIndex, historyItem.PreviousIndexCollection.
Count
), historyItem.TargetItem!);
1339
historyItem.IndexCollection!.Insert(Math.Min(historyItem.Index, historyItem.IndexCollection.
Count
), historyItem.TargetItem!);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (1)
105
int sizeOfSet = displayedItems.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
135
for (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)
45
public override bool HasDropDownItems => ParentInternal is not null && ParentInternal.OverflowItems.
Count
> 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (16)
290
ToolStripPanelRow[] rows = new ToolStripPanelRow[RowsInternal.
Count
];
517
if (Controls.
Count
> 0)
521
Control[] controls = new Control[Controls.
Count
];
522
Point[] controlLocations = new Point[Controls.
Count
];
615
if (controls is not null && controls.
Count
> 0)
620
Control[] controlArray = new Control[controls.
Count
];
624
int numRows = RowsInternal.
Count
;
649
if (numRows < RowsInternal.
Count
|| forceLayout)
719
if (row >= RowsInternal.
Count
)
856
int index = RowsInternal.
Count
;
871
if (RowsInternal.
Count
> 0)
884
&& previousRow.ControlsInternal.
Count
== 1
910
if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.
Count
== 1)
928
if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.
Count
> 1)
946
for (int i = 0; i < RowsInternal.
Count
; i++)
1047
for (int i = 0; i < RowsInternal.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (3)
77
int currentCount = value.
Count
;
100
while (
Count
!= 0)
102
RemoveAt(
Count
- 1);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
307
if (ToolStripPanelRow.Cells[ToolStripPanelRow.Cells.
Count
- 1] == this)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (21)
76
Control[] controls = new Control[ControlsInternal.
Count
];
331
if (ControlsInternal.
Count
<= 0)
353
for (int i = 0; i < Cells.
Count
; i++)
385
ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.
Count
- 1, forward: false);
408
ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.
Count
- 1, forward: false);
429
int[] margins = new int[Cells.
Count
];
430
for (int i = 0; i < Cells.
Count
; i++)
439
for (int i = 0; i < Cells.
Count
; i++)
455
for (int i = Cells.
Count
- 1; i >= 0; i--)
471
for (int j = i + 1; j < Cells.
Count
; j++)
473
cellOffsets ??= new int[Cells.
Count
];
491
for (int i = 0; i < Cells.
Count
; i++)
505
ToolStripPanelCell? cell = RowManager.GetNextVisibleCell(Cells.
Count
- 1, forward: false);
526
int[] margins = new int[Cells.
Count
];
527
for (int i = 0; i < Cells.
Count
; i++)
536
for (int i = 0; i < Cells.
Count
; i++)
552
for (int i = Cells.
Count
- 1; i >= 0; i--)
568
for (int j = i + 1; j < Cells.
Count
; j++)
570
cellOffsets ??= new int[Cells.
Count
];
588
for (int i = 0; i < Cells.
Count
; i++)
716
if (ControlsInternal.
Count
== 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (21)
63
if (index < ToolStripPanel.RowsInternal.
Count
- 1)
86
for (int i = 0; i < Row.ControlsInternal.
Count
; i++)
107
ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
133
spaceToFree -= MoveLeft(Row.Cells.
Count
- 1, spaceToFree);
211
if (index + 1 < Row.Cells.
Count
)
240
if (spaceToFree == 0 || index < 0 || index >= Row.ControlsInternal.
Count
)
249
for (int i = index + 1; i < Row.Cells.
Count
; i++)
281
if (Row.Cells.
Count
> 0 && (spaceToFree > freedSpace))
283
ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
314
for (int i = index + 1; i < Row.Cells.
Count
; i++)
331
if (Row.Cells.
Count
== 1)
358
if (index < Row.ControlsInternal.
Count
- 1 /*not the last one in the row*/)
401
if (Row.ControlsInternal.
Count
> 0)
404
for (index = 0; index < Row.Cells.
Count
; index++)
428
if (index < Row.ControlsInternal.
Count
)
454
if (index < Row.ControlsInternal.
Count
- 1)
489
ToolStripPanelCell? nextCell = GetNextVisibleCell(Row.Cells.
Count
- 2, forward: false);
490
ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
531
if (Row.Cells.
Count
> 0 || toolStripToDrag.IsInDesignMode)
534
ToolStripPanelCell? cell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
537
cell = (ToolStripPanelCell)Row.Cells[Row.Cells.
Count
- 1];
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (7)
111
for (int i = 0; i <
Count
; i++)
131
while (
Count
!= 0)
133
RemoveAt(
Count
- 1);
149
if (index <
Count
&& index >= 0)
160
for (int i = 0; i <
Count
; i++)
192
for (int i = 0; i <
Count
; i++)
273
if (index >= 0 && index <
Count
)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowManager.cs (3)
72
if (index >= 0 && index < Row.ControlsInternal.
Count
- 1)
88
for (int i = index; i < Row.Cells.
Count
; i++)
126
for (int i = index + 1; i < Row.ControlsInternal.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (24)
64
if (index < ToolStripPanel.RowsInternal.
Count
- 1)
88
for (int i = 0; i < Row.ControlsInternal.
Count
; i++)
109
ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
135
spaceToFree -= MoveUp(Row.Cells.
Count
- 1, spaceToFree);
213
if (index + 1 < Row.Cells.
Count
)
242
if (spaceToFree == 0 || index < 0 || index >= Row.ControlsInternal.
Count
)
251
for (int i = index + 1; i < Row.Cells.
Count
; i++)
283
if (Row.Cells.
Count
> 0 && (spaceToFree > freedSpace))
285
ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
309
for (int i = index + 1; i < Row.Cells.
Count
; i++)
326
if (Row.Cells.
Count
== 1)
351
if (Row.Cells.
Count
> 0)
355
ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
361
ToolStripPanelCell? lastCellOnRow = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
384
MoveUp(Row.Cells.
Count
- 1, spaceToFree);
407
if (Row.ControlsInternal.
Count
> 0)
410
for (index = 0; index < Row.Cells.
Count
; index++)
434
if (index < Row.ControlsInternal.
Count
)
461
if (index < Row.ControlsInternal.
Count
- 1)
499
ToolStripPanelCell? nextCell = GetNextVisibleCell(Row.Cells.
Count
- 2, forward: false);
500
ToolStripPanelCell? lastCell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
541
if (Row.Cells.
Count
> 0)
543
ToolStripPanelCell? cell = GetNextVisibleCell(Row.Cells.
Count
- 1, forward: false);
568
if (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)
74
if (toolStrip.Items.
Count
== 0)
79
StringBuilder itemNames = new(toolStrip.Items.
Count
);
81
for (int i = 0; i < toolStrip.Items.
Count
; i++)
192
for (int i = 0; ((i < toolStrip.Items.
Count
) && (i < keys.Length)); i++)
239
for (int i = 0; i < controlsToLookIn.
Count
; i++)
255
for (int i = 0; i < controlsToLookIn.
Count
; i++)
262
if ((controlsToLookIn[i].Controls is not null) && controlsToLookIn[i].Controls.
Count
> 0)
289
for (int i = 0; i < controlsCollection.
Count
; i++)
302
for (int i = 0; i < controlsCollection.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonExAccessibleObject.cs (2)
82
NavigateDirection.NavigateDirection_LastChild => DropDownItemsCount > 0 ? _owningToolStripSplitButton.DropDown.Items[_owningToolStripSplitButton.DropDown.Items.
Count
- 1].AccessibilityObject : null,
98
return _owningToolStripSplitButton.DropDownItems.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (6)
124
else if (toolStripItemIndex == -1 && _owner.Items.
Count
== 0)
159
else if (_owner.Items.
Count
== 0)
172
for (int i = 0; i < _owner.DisplayedItems.
Count
; i++)
183
if (_owner.DisplayedItems.
Count
> 0)
185
for (int i = 0; i < _owner.DisplayedItems.
Count
; i++)
198
return _owner.Items.IndexOf(_owner.DisplayedItems[_owner.DisplayedItems.
Count
- 1]);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (7)
67
for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < toolStrip.Items.
Count
; ForwardsWalkingIndex++)
117
for (ForwardsWalkingIndex = 0; ForwardsWalkingIndex < ToolStrip.Items.
Count
; ForwardsWalkingIndex++)
239
for (int j = -1; j < toolStrip.Items.
Count
; j++)
381
for (int j = -1; j < ToolStrip.Items.
Count
; j++)
523
for (int i = 0; i < toolStrip.Items.
Count
; i++)
547
for (int i = 0; i < toolStrip.Items.
Count
; i++)
567
BackwardsWalkingIndex = (backIndex == -1) ? ToolStrip.Items.
Count
- 1 : backIndex - 1;
System\Windows\Forms\Form.cs (5)
3817
if (Controls.
Count
> 1)
3819
for (int index = 0; index < Controls.
Count
; index++)
6230
numWindowListItems = MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.
Count
;
6240
Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.
Count
, "Calling RevertMerge modified the mdiwindowlistitem");
6287
int nSubItems = sourceMenuStrip.MdiWindowListItem.DropDownItems.
Count
;
System\Windows\Forms\Layout\ArrangedElementCollection.cs (3)
26
if (obj is not ArrangedElementCollection other ||
Count
!= other.
Count
)
31
for (int i = 0; i <
Count
; i++)
System\Windows\Forms\Layout\CommonProperties.cs (1)
364
for (int i = 0; i < controlsCollection.
Count
; i++)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (4)
1039
for (int i = 0; i < controlsCollection.
Count
; i++)
1059
for (int i = 0; i < controlsCollection.
Count
; i++)
1251
if (Controls.
Count
== 0)
1971
int count = children.
Count
;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1794
if ((Panel1.Controls.
Count
> 0 || Panel2.Controls.
Count
> 0) || TabStop)
System\Windows\Forms\Layout\DefaultLayout.cs (7)
27
for (int i = children.
Count
- 1; i >= 0; i--)
361
for (int i = children.
Count
- 1; i >= 0; i--)
388
for (int i = children.
Count
- 1; i >= 0; i--)
605
if (!measureOnly && children.
Count
== 0)
613
for (int i = children.
Count
- 1; i >= 0; i--)
699
for (int i = 0; i < controls.
Count
; i++)
1117
for (int i = children.
Count
- 1; i >= 0; i--)
System\Windows\Forms\Layout\FlowLayout.cs (5)
74
for (int i = 0; i < container.Children.
Count
;)
81
Debug.Assert(wrapContents || breakIndex == container.Children.
Count
,
99
if (container.Children.
Count
!= 0 && !measureOnly)
147
endIndex: containerProxy.Container.Children.
Count
,
337
for (int i = 1; i < collection.
Count
; i++)
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (2)
237
LayoutInfo[] childInfo = new LayoutInfo[children.
Count
];
240
for (int i = 0; i < children.
Count
; i++)
System\Windows\Forms\Layout\TableLayout.cs (6)
1298
if (children is null || children.
Count
== 0)
1310
for (int i = 0; i < children.
Count
; i++)
1334
if (children is null || children.
Count
== 0)
1394
List<LayoutInfo> childrenInfo = new(children.
Count
);
1398
for (int i = 0; i < children.
Count
; i++)
1455
List<LayoutInfo> layoutInfos = new(container.Children.
Count
);
System\Windows\Forms\MDI\MDIClient.cs (1)
243
for (int i = 0; i < Controls.
Count
; i++)
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
97
Debug.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)
172
return collection is not null && collection.
Count
> 0;
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (1)
497
List<ControlInformation> controlsInfo = new(Owner!.Children.
Count
);
System\Windows\Forms\Scrolling\ScrollableControl.cs (5)
335
if (Controls.
Count
!= 0)
347
for (int i = 0; i < Controls.
Count
; i++)
400
else if (Controls.
Count
!= 0)
403
for (int i = 0; i < Controls.
Count
; i++)
809
for (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)
152
Control[] childControls = new Control[root.Controls.
Count
];
System\Drawing\Design\ColorEditor.ColorUI.ColorEditorTabControl.cs (1)
21
if (selectedTab is not null && selectedTab.Controls.
Count
> 0)
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
325
if (selectedPage is not null && selectedPage.Controls.
Count
> 0)
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (3)
434
nextTabIndex = Controls.
Count
- 1;
436
else if (nextTabIndex >= Controls.
Count
)
441
for (int i = 0; i < Controls.
Count
; i++)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (2)
402
numberOfOriginalTrayControls = tray is not null ? tray.Controls.
Count
: 0;
528
int numberOfTrayControlsAdded = tray.Controls.
Count
- numberOfOriginalTrayControls;
System\Windows\Forms\Design\CommandSet.cs (3)
1786
if (controlCommonParent.Controls.
Count
> 0)
1855
int numberOfOriginalTrayControls = tray is not null ? tray.Controls.
Count
: 0;
2137
int numberOfTrayControlsAdded = tray.Controls.
Count
- numberOfOriginalTrayControls;
System\Windows\Forms\Design\ComponentTray.cs (3)
227
for (int i = 0; i < children.
Count
; ++i)
444
get => Controls.
Count
;
1377
int controlCount = Controls.
Count
;
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (2)
299
for (int i = 0; i < parent.Controls.
Count
; i++)
417
for (int i = control.Controls.
Count
- 1; i >= 0; i--)
System\Windows\Forms\Design\ControlCommandSet.cs (8)
1142
if (_baseControl is not null && _baseControl.Controls.
Count
> 0)
1392
if (current.Controls.
Count
> 0)
1511
if (ctlControls is not null && ctlControls.
Count
> 0)
1517
for (int c = 0; c < ctlControls.
Count
; c++)
1545
parentControlCount = parentControls.
Count
;
1613
parentControlCount = parentControls.
Count
;
1679
while (ctlControls is not null && ctlControls.
Count
> 0)
1686
for (int c = ctlControls.
Count
- 1; c >= 0; c--)
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (2)
22
public override int Count => _realCollection.
Count
;
70
for (int i = _realCollection.
Count
- 1; i >= 0; i--)
System\Windows\Forms\Design\DesignerFrame.cs (1)
318
List<ThemedScrollbarWindow> windows = new(Controls.
Count
);
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (5)
171
if (children.
Count
== 0)
178
_childInfo = new ChildInfo[children.
Count
];
197
for (i = 0; i < children.
Count
; i++)
658
_insertionIndex = children.
Count
;
886
_insertionIndex = FlowLayoutPanel.Controls.
Count
;
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (2)
54
if (Items.
Count
> 0 && items.Count > 0)
80
e.Cancel = (Items.
Count
== 0);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
608
Control[] children = new Control[parent.Controls.
Count
];
869
int controlCount = control.Controls.
Count
;
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
132
if (_splitterPanel.Controls.
Count
== 0)
211
if (_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)
1181
for (int i = 0; i < Control.Controls.
Count
; i++)
2153
public override int Count => _realCollection.
Count
;
2208
for (int i = _realCollection.
Count
- 1; i >= 0; i--)
System\Windows\Forms\Design\TabOrder.cs (3)
361
for (int n = 0; n < ctl.Controls.
Count
; n++)
420
int count = control.Controls.
Count
;
430
if (ctlTab.Controls.
Count
> 0)
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (1)
18
if (toolStrip.Items.
Count
== 0)
System\Windows\Forms\Design\ToolStripDesigner.cs (8)
904
int count = ToolStrip.Items.
Count
;
1055
if (ToolStrip.Items.
Count
> 1)
1057
itemIndex = Math.Min(ToolStrip.Items.
Count
- 1, itemIndex);
1274
if (ToolStrip.Items.
Count
> 0)
1276
ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.
Count
];
1546
index = parent.Controls.
Count
- 1;
1576
index = parent.Controls.
Count
;
1959
if (currentIndexOfEditor == -1 || currentIndexOfEditor != ToolStrip.Items.
Count
- 1)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (3)
626
int count = _dropDown.Items.
Count
- 1;
667
if (_dropDown.Items.
Count
> 0)
669
ToolStripItem[] items = new ToolStripItem[_dropDown.Items.
Count
];
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
540
if (item is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.
Count
> 1 /*including TN*/)
562
if (item is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.
Count
> 1 /*including TN*/)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (10)
336
parentControlCount = parentControls.
Count
;
391
parentControlCount = parentControls.
Count
;
683
int count = parent.Items.
Count
;
728
int count = parent.Items.
Count
;
1703
next = current.Controls.
Count
> 0 ? current.Controls[0] : (object)current;
1829
targetSelection = !backwards ? collection[0] : (object)collection[wb.Items.
Count
- 1];
1970
targetSelection = collection.
Count
>= 2 ? collection[collection.
Count
- 2] : GetNextControlInTab(baseCtl, parent, !backwards);
2025
object[] totalObjects = new object[parent.Items.
Count
- 1];
2026
for (int i = 0; i < parent.Items.
Count
- 1; i++)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (12)
135
if (MenuItem.DropDown.IsAutoGenerated && MenuItem.DropDownItems.
Count
> 0)
154
ToolStripItem[] items = new ToolStripItem[MenuItem.DropDownItems.
Count
];
701
if (MenuItem.DropDownItems.
Count
== 0)
951
if (index != -1 && MenuItem.DropDownItems.
Count
> index)
1160
if (ddi.DropDown.Site is not null || ddi.DropDownItems.
Count
== 1)
1387
for (int i = 0; i < wb.Items.
Count
; i++)
1693
int count = MenuItem.DropDownItems.
Count
;
1907
if (ownerItem.DropDownItems.
Count
> 1)
1909
itemIndex = Math.Min(ownerItem.DropDownItems.
Count
- 1, itemIndex);
2034
if (currentIndexOfEditor >= 0 && currentIndexOfEditor < MenuItem.DropDown.Items.
Count
- 1)
2317
if (ownerItem.DropDownItems.
Count
> 0 && ownerItem.DropDownItems[0] is DesignerToolStripControlHost)
2446
count = MenuItem.DropDownItems.
Count
;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
391
if (Control.Controls.
Count
== 0)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (3)
1439
if (_addItemButton.DropDownItems.
Count
> 0)
1451
Debug.Assert(_addItemButton.DropDownItems.
Count
> 0);
1667
for (int i = 0; i < Items.
Count
; i++)
System.Windows.Forms.Design.Tests (3)
System\Windows\Forms\Design\GroupedContextMenuStripTests.cs (3)
15
groupedContextMenuStrip.Items.
Count
.Should().Be(0);
28
groupedContextMenuStrip.Items.
Count
.Should().Be(1);
44
groupedContextMenuStrip.Items.
Count
.Should().Be(3);
System.Windows.Forms.Tests (34)
BindingNavigatorTests.cs (1)
113
Assert.Equal(11, bn.Items.
Count
);
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (4)
143
Assert.Equal(2, menuStrip.Items.
Count
);
151
Assert.Equal(3, menuStrip.Items.
Count
);
183
Assert.Equal(2, menuStrip.Items.
Count
);
191
Assert.Equal(3, menuStrip.Items.
Count
);
System\Windows\Forms\MdiControlStripTests.cs (1)
66
Assert.Equal(2, mdiControlStrip.DisplayedItems.
Count
);
System\Windows\Forms\PropertyGridTests.cs (1)
73
Assert.Equal(4, control.Controls.
Count
);
System\Windows\Forms\StatusStripTests.cs (5)
743
Assert.Equal(expectedChildrenCallCount1, control.Controls.
Count
);
749
Assert.Equal(expectedChildrenCallCount1, control.Controls.
Count
);
755
Assert.Equal(expectedChildrenCallCount2, control.Controls.
Count
);
1033
Assert.Equal(expectedChildrenCallCount1, control.Controls.
Count
);
1044
Assert.Equal(expectedChildrenCallCount1, control.Controls.
Count
);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
4891
for (int i = 1; i < items.
Count
; i++) // it needs for correct work of ToolStrip.GetNextItemVertical method
System\Windows\Forms\ToolStripItemCollectionTests.cs (6)
122
Assert.Equal(3, contextMenuStrip.Items.
Count
);
142
toolStrip.Items.
Count
.Should().Be(0);
146
itemCollection.
Count
.Should().Be(2);
147
toolStrip.Items.
Count
.Should().Be(2);
164
collection.
Count
.Should().Be(2);
294
collection.
Count
.Should().Be(1);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
250
item.DropDownItems.
Count
.Should().Be(2);
System\Windows\Forms\ToolStripPanel.ToolStripPanelRowCollectionTests.cs (10)
52
toolStripPanelRowCollection.
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)
7356
while (listToolStripMenuItem.DropDownItems.
Count
> 0)
7357
listToolStripMenuItem.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)