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)
2160
public override int
Count
=> _realCollection.Count;
456 references to Count
System.Windows.Forms (330)
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)
2144
public bool HasChildren => ChildControls is not null && ChildControls.
Count
> 0;
3361
for (int i = 0; i < children.
Count
; i++)
4582
Control[] controlSnapshot = new Control[children.
Count
];
4740
for (int i = 0; i < children.
Count
; i++)
4775
for (int i = 0; i < children.
Count
; i++)
5372
List<ControlTabOrderHolder> holders = new(Controls.
Count
);
5403
for (int c = 0; c < children.
Count
; c++)
5415
for (int c = children.
Count
- 1; c >= 0; c--)
5485
if (ChildControls is { } children && children.
Count
> 0 && (ctl == this || !IsFocusManagingContainerControl(ctl)))
5510
parentChildCount = parentChildren.
Count
;
5568
int siblingCount = siblings.
Count
;
5640
while (children is not null && children.
Count
> 0 && (ctl == this || !IsFocusManagingContainerControl(ctl)))
6567
for (int i = 0; i < children.
Count
; i++)
6591
for (int i = 0; i < children.
Count
; i++)
6634
for (int i = 0; i < children.
Count
; i++)
6678
for (int i = 0; i < children.
Count
; i++)
6700
for (int i = 0; i < children.
Count
; i++)
6749
for (int i = 0; i < children.
Count
; i++)
6793
for (int i = 0; i < children.
Count
; i++)
6820
for (int i = 0; i < children.
Count
; i++)
6848
for (int i = 0; i < children.
Count
; i++)
7033
for (int i = 0; i < children.
Count
; i++)
7133
for (int i = 0; i < children.
Count
; i++)
7153
for (int i = 0; i < children.
Count
; i++)
7587
for (int i = 0; i < children.
Count
; i++)
7981
for (int i = 0; i < children.
Count
; i++)
8729
int count = Controls.
Count
;
8753
if (Controls.
Count
== 0)
9142
if (ChildControls is { } children && children.
Count
> 0)
9144
controlSnapshot = new Control[children.
Count
];
9145
for (int i = 0; i < children.
Count
; i++)
9410
for (int i = 0; i < children.
Count
; i++)
9499
for (int i = 0; i < children.
Count
; i++)
9572
for (int i = 0; i < children.
Count
; i++)
9791
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)
935
LayoutTransaction.DoLayoutIf((Items.
Count
> 0), this, this, PropertyNames.ImageScalingSize);
1712
for (int i = 0; i < Items.
Count
; i++)
1789
ToolStripItem[] displayedItems = new ToolStripItem[DisplayedItems.
Count
];
1914
for (int i = Items.
Count
- 1; i >= 0; i--)
2072
if (DisplayedItems.
Count
<= 0)
2083
start ??= forward ? DisplayedItems[DisplayedItems.
Count
- 1] : DisplayedItems[0];
2091
int count = DisplayedItems.
Count
;
2145
for (int i = 0; i < DisplayedItems.
Count
; i++)
2281
for (int j = 0; j < toolStrip.Items.
Count
; j++)
2302
if (toolStrip.Items.
Count
== 0 || (!foundItemParticipatingInLayout))
2340
for (int j = 0; j < toolStrip.Items.
Count
; j++)
2361
if (toolStrip.Items.
Count
== 0 || !foundItemParticipatingInLayout)
2406
for (int i = 0; i < DisplayedItems.
Count
; i++)
2522
for (int i = 0; i < Items.
Count
; i++)
2528
Invalidate(Controls.
Count
> 0);
2544
for (int j = 0; j < DisplayedItems.
Count
; j++)
2890
for (int i = 0; i < DisplayedItems.
Count
; i++)
2894
index = (index + 1) % DisplayedItems.
Count
;
2953
for (int i = 0; i < DisplayedItems.
Count
; i++)
2956
index = (index + 1) % DisplayedItems.
Count
;
3144
for (int i = 0; i < Items.
Count
; i++)
3171
for (int i = 0; i < Items.
Count
; i++)
3264
for (int j = 0; j < Items.
Count
; j++)
3501
for (int i = 0; i < DisplayedItems.
Count
; i++)
3616
for (int i = 0; i < Items.
Count
; i++)
3888
for (int i = 0; i < DisplayedItems.
Count
; i++)
3940
if (toolStripItem is ToolStripDropDownItem dropDownItem && dropDownItem.DropDownItems.
Count
> 0)
4267
for (; j >= 0 && j < Items.
Count
; j = (pass == 0) ? j + 1 : j - 1)
4316
if (OverflowItems.
Count
== 0)
4333
for (int j = 0; j < Items.
Count
; j++)
4478
return $"{base.ToString()}, Name: {Name}, Items: {Items.
Count
}";
4709
int i = Items.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (14)
57
if (index < owner.Items.
Count
)
63
for (int i = 0; i < owner.Items.
Count
; ++i)
80
for (int i = 0; i < owner.Items.
Count
; ++i)
109
if (owner.CanOverflow && owner.OverflowButton.Visible && index == owner.Items.
Count
)
129
for (int i = 0; i < owner.Items.
Count
; i++)
164
&& fragmentIndex == items.
Count
- 1)
169
if (fragmentIndex < items.
Count
)
216
for (int i = index + 1; i < items.
Count
; i++)
266
return owner.OverflowItems.
Count
;
276
return owner.DisplayedItems.
Count
;
312
for (int index = 0; index < items.
Count
; index++)
344
return owner.Items.
Count
+ index;
348
for (int i = 0; i < owner.Items.
Count
; ++i)
362
for (int i = 0; i < owner.Items.
Count
; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1592
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++)
621
if (Items.
Count
> 0)
644
if (!RequiresScrollButtons || Items.
Count
== 0)
663
for (int i = 0; i < Items.
Count
&& deltaToScroll < requiredScrollAmount; ++i)
667
Rectangle adjustedLastItemBounds = Items[Items.
Count
- 1].Bounds;
677
if (i < Items.
Count
- 1)
690
for (int i = Items.
Count
- 1; i >= 0 && deltaToScroll > requiredScrollAmount; --i)
734
if (_indexOfFirstDisplayedItem == -1 || _indexOfFirstDisplayedItem >= Items.
Count
)
760
if (_indexOfFirstDisplayedItem == Items.
Count
- 1)
821
for (int i = 0; i < Items.
Count
; ++i)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
33
for (int i = 0; i < _owner.Items.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
3559
int i = 0, count = items.
Count
;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (10)
148
for (int i = 0; i < toolStripItems.
Count
; i++)
170
if (
Count
== 0)
186
while (
Count
!= 0)
188
RemoveAt(
Count
- 1);
252
for (int i = 0; i < itemsToLookIn.
Count
; i++)
268
for (int j = 0; j < itemsToLookIn.
Count
; j++)
353
for (int i = 0; i <
Count
; i++)
372
return ((index >= 0) && (index <
Count
));
429
if (index <
Count
&& index >= 0)
481
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
;
657
if (numRows < RowsInternal.
Count
|| forceLayout)
727
if (row >= RowsInternal.
Count
)
864
int index = RowsInternal.
Count
;
879
if (RowsInternal.
Count
> 0)
892
&& previousRow.ControlsInternal.
Count
== 1
918
if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.
Count
== 1)
936
if (currentToolStripPanelRow is not null && currentToolStripPanelRow.ControlsInternal.
Count
> 1)
954
for (int i = 0; i < RowsInternal.
Count
; i++)
1055
for (int i = 0; i < RowsInternal.
Count
; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (4)
77
int currentCount = value.
Count
;
100
while (
Count
!= 0)
102
RemoveAt(
Count
- 1);
156
if (index <
Count
&& index >= 0)
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)
369
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)
146
endIndex: containerProxy.Container.Children.
Count
,
336
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)
1299
if (children is null || children.
Count
== 0)
1311
for (int i = 0; i < children.
Count
; i++)
1335
if (children is null || children.
Count
== 0)
1395
List<LayoutInfo> childrenInfo = new(children.
Count
);
1399
for (int i = 0; i < children.
Count
; i++)
1456
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;
2135
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++)
404
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++)
2160
public override int Count => _realCollection.
Count
;
2215
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)
911
int count = ToolStrip.Items.
Count
;
1062
if (ToolStrip.Items.
Count
> 1)
1064
itemIndex = Math.Min(ToolStrip.Items.
Count
- 1, itemIndex);
1281
if (ToolStrip.Items.
Count
> 0)
1283
ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.
Count
];
1553
index = parent.Controls.
Count
- 1;
1583
index = parent.Controls.
Count
;
1978
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
;
699
int count = parent.Items.
Count
;
744
int count = parent.Items.
Count
;
1720
next = current.Controls.
Count
> 0 ? current.Controls[0] : (object)current;
1846
targetSelection = !backwards ? collection[0] : (object)collection[wb.Items.
Count
- 1];
1987
targetSelection = collection.
Count
>= 2 ? collection[collection.
Count
- 2] : GetNextControlInTab(baseCtl, parent, !backwards);
2042
object[] totalObjects = new object[parent.Items.
Count
- 1];
2043
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
];
711
if (MenuItem.DropDownItems.
Count
== 0)
967
if (index != -1 && MenuItem.DropDownItems.
Count
> index)
1176
if (ddi.DropDown.Site is not null || ddi.DropDownItems.
Count
== 1)
1403
for (int i = 0; i < wb.Items.
Count
; i++)
1709
int count = MenuItem.DropDownItems.
Count
;
1923
if (ownerItem.DropDownItems.
Count
> 1)
1925
itemIndex = Math.Min(ownerItem.DropDownItems.
Count
- 1, itemIndex);
2050
if (currentIndexOfEditor >= 0 && currentIndexOfEditor < MenuItem.DropDown.Items.
Count
- 1)
2333
if (ownerItem.DropDownItems.
Count
> 0 && ownerItem.DropDownItems[0] is DesignerToolStripControlHost)
2462
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)
12
groupedContextMenuStrip.Items.
Count
.Should().Be(0);
25
groupedContextMenuStrip.Items.
Count
.Should().Be(1);
41
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 (6)
136
Assert.Equal(1, menuStrip.Items.
Count
);
143
Assert.Equal(2, menuStrip.Items.
Count
);
151
Assert.Equal(3, menuStrip.Items.
Count
);
176
Assert.Equal(1, 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 (4)
113
Assert.Equal(0, contextMenuStrip.Items.
Count
);
120
Assert.Equal(3, contextMenuStrip.Items.
Count
);
139
collection.
Count
.Should().Be(2);
269
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)