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