2 overrides of Selected
System.Windows.Forms (2)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
350
public override bool
Selected
=> _control is not null && _control.Focused;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonButton.cs (1)
90
public override bool
Selected
202 references to Selected
System.Windows.Forms (52)
System\Windows\Forms\Controls\Menus\MenuTimer.cs (2)
125
bool rollup = forceClose || (CurrentItem is not null && CurrentItem != lastSelected && CurrentItem.
Selected
);
168
if (CurrentItem is not null && !CurrentItem.IsDisposed && CurrentItem.
Selected
&& CurrentItem.Enabled && ToolStripManager.ModalMenuFilter.InMenuMode)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStripButton.cs (1)
71
if (!
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
1810
if (displayedItems[i].
Selected
)
2408
if (DisplayedItems[i].
Selected
)
3098
else if (item.
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.ToolStripButtonAccessibleObject.cs (1)
60
if (!_ownerItem.Enabled && _ownerItem.
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (1)
201
if (
Selected
&& !Pressed && SystemInformation.HighContrast)
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (10)
146
else if (item.
Selected
)
154
Color arrowColor = item.
Selected
&& !item.Pressed ? SystemColors.HighlightText : SystemColors.ControlText;
184
if (e.Item is ToolStripMenuItem menuItem && !e.Item.IsOnDropDown && (menuItem.Checked || menuItem.
Selected
))
191
if (menuItem.
Selected
)
206
: item.
Selected
&& !item.Pressed ? SystemColors.HighlightText
218
if (e.Item.
Selected
&& (!e.Item.Pressed || e.Item is ToolStripButton))
225
if (e.Item.
Selected
|| e.Item.Pressed)
414
if (button.
Selected
)
455
else if (e.Item.
Selected
)
494
if (IsHighContrastWhiteOnBlack() && !(FillWhenSelected && (item.Pressed || item.
Selected
)))
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
1778
/// Occurs when value of the <see cref="
Selected
" /> property changes.
2502
if (Enabled && CanSelect && !
Selected
)
3144
if (!
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (4)
110
UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId => (VARIANT)_ownerItem.
Selected
,
171
if (_ownerItem.
Selected
&& _ownerItem is ToolStripMenuItem)
178
if (_ownerItem.
Selected
&& _ownerItem is ToolStripMenuItem)
187
if (_ownerItem.
Selected
|| _ownerItem.Pressed)
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (1)
366
else if (
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (3)
903
if (ParentInternal is not null && ParentInternal.MenuAutoExpand &&
Selected
)
962
if (
Selected
|| Pressed)
1010
Color arrowColor = (
Selected
|| Pressed) ? SystemColors.HighlightText : SystemColors.MenuText;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (14)
269
Rectangle fillRect = item.
Selected
? item.ContentRectangle : bounds;
273
bool buttonPressedOrSelected = (item.Pressed || item.ButtonPressed || item.
Selected
|| item.ButtonSelected);
355
Rectangle fillRect = item is not null && item.
Selected
? item.ContentRectangle : bounds;
364
if (item is not null && item.
Selected
)
378
if (item is not null && item.
Selected
)
564
if (item.
Selected
)
618
else if (item.
Selected
)
715
if (e.Item is ToolStripMenuItem && (e.Item.
Selected
|| e.Item.Pressed))
919
else if (item.
Selected
)
1056
Color fill = (e.Item.
Selected
) ? ColorTable.CheckSelectedBackground : ColorTable.CheckBackground;
1110
Rectangle fillRect = item.
Selected
? item.ContentRectangle : bounds;
1249
else if (item is not null && item.
Selected
)
1570
Rectangle fillRect = (item.
Selected
) ? item.ContentRectangle : bounds;
1582
else if (item.
Selected
)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
835
Color backgroundColor = e.Item.
Selected
? SystemColors.Highlight : e.Item.BackColor;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
184
public bool DropDownButtonSelected =>
Selected
;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.ToolStripSplitButtonButton.cs (2)
96
return _owner.
Selected
;
99
return base.
Selected
;
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (4)
159
if (toolStripButton.
Selected
)
172
else if (item.
Selected
)
452
if (item.
Selected
|| item.Pressed)
599
Rectangle fillRect = splitButton.
Selected
? splitButton.ContentRectangle : bounds;
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
1141
if (sender is ToolStripItem item && !item.
Selected
)
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1669
if (Items[i].
Selected
)
System.Windows.Forms.Tests (149)
System\Windows\Forms\ControlTests.cs (4)
965
Assert.True(toolStrip2.Items[0].
Selected
);
970
Assert.True(toolStrip2.Items[0].
Selected
);
1022
Assert.True(toolStrip1.Items[0].
Selected
);
1027
Assert.True(toolStrip1.Items[0].
Selected
);
System\Windows\Forms\ToolStripButtonTests.cs (7)
80
Assert.False(item.
Selected
);
161
Assert.False(item.
Selected
);
248
Assert.False(item.
Selected
);
338
Assert.False(item.
Selected
);
426
Assert.False(item.
Selected
);
524
Assert.False(item.
Selected
);
1067
Assert.Equal(item.CanSelect, item.
Selected
);
System\Windows\Forms\ToolStripDropDownItemTests.cs (4)
80
Assert.False(item.
Selected
);
169
Assert.False(item.
Selected
);
268
Assert.False(item.
Selected
);
376
Assert.False(item.
Selected
);
System\Windows\Forms\ToolStripItemTests.cs (130)
79
Assert.False(item.
Selected
);
164
Assert.False(item.
Selected
);
259
Assert.False(item.
Selected
);
1130
Assert.False(item.
Selected
);
1136
Assert.False(item.
Selected
);
1142
Assert.False(item.
Selected
);
1168
Assert.False(item.
Selected
);
1174
Assert.False(item.
Selected
);
1180
Assert.False(item.
Selected
);
1189
Assert.True(item.
Selected
);
1194
Assert.Equal(value, item.
Selected
);
1200
Assert.Equal(value, item.
Selected
);
1206
Assert.False(item.
Selected
);
1224
Assert.False(item.
Selected
);
1231
Assert.False(item.
Selected
);
1238
Assert.False(item.
Selected
);
1268
Assert.False(item.
Selected
);
1275
Assert.False(item.
Selected
);
1282
Assert.False(item.
Selected
);
1320
Assert.False(item.
Selected
);
1330
Assert.False(item.
Selected
);
1340
Assert.False(item.
Selected
);
1362
Assert.False(item.
Selected
);
1369
Assert.False(item.
Selected
);
1376
Assert.False(item.
Selected
);
1406
Assert.False(item.
Selected
);
1413
Assert.False(item.
Selected
);
1420
Assert.False(item.
Selected
);
1446
Assert.False(item.
Selected
);
1456
Assert.False(item.
Selected
);
1466
Assert.False(item.
Selected
);
2545
Assert.True(item.
Selected
);
2549
Assert.Equal(value, item.
Selected
);
2554
Assert.Equal(value, item.
Selected
);
2559
Assert.False(item.
Selected
);
7682
Assert.False(item.
Selected
);
7702
Assert.False(item.
Selected
);
7713
Assert.False(item.
Selected
);
7725
Assert.False(item.
Selected
);
7740
Assert.False(item.
Selected
);
7751
Assert.False(item.
Selected
);
7763
Assert.False(item.
Selected
);
7778
Assert.False(item.
Selected
);
7796
Assert.True(item.
Selected
);
9180
Assert.False(item.
Selected
);
9186
Assert.False(item.
Selected
);
9192
Assert.False(item.
Selected
);
9218
Assert.False(item.
Selected
);
9224
Assert.False(item.
Selected
);
9230
Assert.False(item.
Selected
);
9239
Assert.True(item.
Selected
);
9244
Assert.Equal(value, item.
Selected
);
9250
Assert.Equal(value, item.
Selected
);
9256
Assert.False(item.
Selected
);
9274
Assert.False(item.
Selected
);
9281
Assert.False(item.
Selected
);
9288
Assert.False(item.
Selected
);
9318
Assert.False(item.
Selected
);
9325
Assert.False(item.
Selected
);
9332
Assert.False(item.
Selected
);
9370
Assert.False(item.
Selected
);
9380
Assert.False(item.
Selected
);
9390
Assert.False(item.
Selected
);
9412
Assert.False(item.
Selected
);
9419
Assert.False(item.
Selected
);
9426
Assert.False(item.
Selected
);
9456
Assert.False(item.
Selected
);
9463
Assert.False(item.
Selected
);
9470
Assert.False(item.
Selected
);
9496
Assert.False(item.
Selected
);
9506
Assert.False(item.
Selected
);
9516
Assert.False(item.
Selected
);
14263
Assert.Equal(item.CanSelect, item.
Selected
);
14267
Assert.Equal(item.CanSelect, item.
Selected
);
14286
Assert.True(item.
Selected
);
14290
Assert.True(item.
Selected
);
14298
Assert.False(item.
Selected
);
14302
Assert.False(item.
Selected
);
14322
Assert.True(item.
Selected
);
14323
Assert.True(ownerItem.
Selected
);
14327
Assert.True(item.
Selected
);
14328
Assert.True(ownerItem.
Selected
);
14344
Assert.True(item.
Selected
);
14345
Assert.False(ownerItem.
Selected
);
14349
Assert.True(item.
Selected
);
14350
Assert.False(ownerItem.
Selected
);
14363
Assert.True(item.
Selected
);
14368
Assert.True(item.
Selected
);
14389
Assert.True(item.
Selected
);
14397
Assert.True(item.
Selected
);
14415
Assert.False(item.
Selected
);
14419
Assert.False(item.
Selected
);
14435
Assert.False(item.
Selected
);
14439
Assert.False(item.
Selected
);
14452
Assert.True(item.
Selected
);
14457
Assert.True(item.
Selected
);
14478
Assert.True(item.
Selected
);
14486
Assert.True(item.
Selected
);
14504
Assert.True(item.
Selected
);
14508
Assert.True(item.
Selected
);
14524
Assert.False(item.
Selected
);
14528
Assert.False(item.
Selected
);
14841
Assert.False(item.
Selected
);
14847
Assert.False(item.
Selected
);
14853
Assert.False(item.
Selected
);
14880
Assert.False(item.
Selected
);
14886
Assert.False(item.
Selected
);
14892
Assert.False(item.
Selected
);
14901
Assert.True(item.
Selected
);
14906
Assert.Equal(value, item.
Selected
);
14912
Assert.Equal(value, item.
Selected
);
14918
Assert.False(item.
Selected
);
14936
Assert.False(item.
Selected
);
14943
Assert.False(item.
Selected
);
14950
Assert.False(item.
Selected
);
14980
Assert.False(item.
Selected
);
14987
Assert.False(item.
Selected
);
14994
Assert.False(item.
Selected
);
15032
Assert.False(item.
Selected
);
15042
Assert.False(item.
Selected
);
15052
Assert.False(item.
Selected
);
15074
Assert.False(item.
Selected
);
15081
Assert.False(item.
Selected
);
15088
Assert.False(item.
Selected
);
15118
Assert.False(item.
Selected
);
15125
Assert.False(item.
Selected
);
15132
Assert.False(item.
Selected
);
15158
Assert.False(item.
Selected
);
15168
Assert.False(item.
Selected
);
15178
Assert.False(item.
Selected
);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
87
Assert.False(item.
Selected
);
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
77
Assert.False(item.
Selected
);
System\Windows\Forms\ToolStripTests.cs (2)
5832
Assert.Equal(item.CanSelect, item.
Selected
);
5835
Assert.False(item.
Selected
);