1 write to Item
System.Windows.Forms (1)
System\Windows\Forms\Controls\ToolStrips\ToolStripItemRenderEventArgs.cs (1)
16Item = item.OrThrowIfNull();
99 references to Item
System.Windows.Forms (81)
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (33)
98if (e.Item.Pressed) 100e.Graphics.DrawRectangle(SystemPens.ButtonHighlight, new Rectangle(0, 0, e.Item.Width - 1, e.Item.Height - 1)); 135Rectangle bounds = new(Point.Empty, e.Item.Size); 138if (e.Item is ToolStripSplitButton item) 151DrawHightContrastDashedBorder(g, e.Item); 179if (!e.Item.IsOnDropDown && e.Item.Pressed) 181e.Graphics.DrawRectangle(SystemPens.ButtonHighlight, 0, 0, e.Item.Width - 1, e.Item.Height - 1); 184if (e.Item is ToolStripMenuItem menuItem && !e.Item.IsOnDropDown && (menuItem.Checked || menuItem.Selected)) 203ToolStripItem item = e.Item; 218if (e.Item.Selected && (!e.Item.Pressed || e.Item is ToolStripButton)) 225if (e.Item.Selected || e.Item.Pressed) 237if ((typeof(ToolStripButton).IsAssignableFrom(e.Item.GetType()) 238&& ((ToolStripButton)e.Item).DisplayStyle != ToolStripItemDisplayStyle.Image 239&& ((ToolStripButton)e.Item).Checked) 240|| (typeof(ToolStripMenuItem).IsAssignableFrom(e.Item.GetType()) 241&& ((ToolStripMenuItem)e.Item).DisplayStyle != ToolStripItemDisplayStyle.Image 242&& !e.Item.IsOnDropDown 243&& ((ToolStripMenuItem)e.Item).Checked)) 350Rectangle bounds = new(Point.Empty, e.Item.Size); 407if (e.Item is ToolStripButton button && button.Checked) 410Rectangle bounds = new(Point.Empty, e.Item.Size); 442Rectangle bounds = new(Point.Empty, e.Item.Size); 444if (e.Item.Pressed) 455else if (e.Item.Selected) 458DrawHightContrastDashedBorder(g, e.Item); 490ToolStripItem item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemRenderEventArgs.cs (1)
32public ToolStrip? ToolStrip => Item.ParentInternal;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (26)
156ToolStripItem item = e.Item; 228if (e.Item is ToolStripDropDownItem item && item.Pressed && item.HasDropDownItems) 248RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical); 261if (e.Item is not ToolStripSplitButton item) 319ToolStripStatusLabel? item = e.Item as ToolStripStatusLabel; 345ToolStripButton? item = e.Item as ToolStripButton; 544ToolStripItem item = e.Item; 715if (e.Item is ToolStripMenuItem && (e.Item.Selected || e.Item.Pressed)) 717e.DefaultTextColor = e.Item.ForeColor; 746if (e.Item is ToolStripMenuItem) 748ToolStripMenuItem? item = e.Item as ToolStripMenuItem; 760if (!e.Item.Enabled) 767if (e.Item.ImageScaling == ToolStripItemImageScaling.None) 1048(e.Item.Height - e.ImageRectangle.Height) / 2 - 1, 1050: new Rectangle(e.ImageRectangle.Left - 2, 1, e.ImageRectangle.Width + 4, e.Item.Height - 2); 1056Color fill = (e.Item.Selected) ? ColorTable.CheckSelectedBackground : ColorTable.CheckBackground; 1057fill = (e.Item.Pressed) ? ColorTable.CheckPressedBackground : fill; 1066if (e.Item.Pressed) 1107ToolStripItem item = e.Item; 1213ScaleObjectSizesIfNeeded(e.Item.DeviceDpi); 1216ToolStripOverflowButton? item = e.Item as ToolStripOverflowButton; 1217Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size); 1566ToolStripItem item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (11)
784if (e.ShiftOnPress && e.Item is not null && e.Item.Pressed) 789if (e.Item is not null && !e.Item.Enabled) 795if (e.Item?.ImageScaling == ToolStripItemImageScaling.None) 826if (e.Item is not null) 828if (!e.Item.Enabled) 835Color backgroundColor = e.Item.Selected ? SystemColors.Highlight : e.Item.BackColor; 839Image invertedImage = ControlPaint.CreateBitmapWithInvertedForeColor(bitmap, e.Item.BackColor); 864ToolStripItem? item = e.Item;
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (10)
380ToolStripItem item = e.Item; 411ToolStripMenuItem? item = e.Item as ToolStripMenuItem; 490RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical); 496ToolStripStatusLabel? item = e.Item as ToolStripStatusLabel; 516if (e.Item is not ToolStripSplitButton splitButton) 580ToolBarState state = GetToolBarState(e.Item); 581if (e.Item is ToolStripSplitButton item && !SystemInformation.HighContrast && 645ToolStripItem item = e.Item; 790ToolStripItem item = e.Item;
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (3)
1884ToolStripItem item = e.Item; 1972if (e.Item is ToolStripSplitButton splitButton) 2043ToolStripItem item = e.Item as ToolStripLabel;
System.Windows.Forms.Tests (15)
System\Windows\Forms\ToolStripButtonTests.cs (6)
1291Assert.Same(item, e.Item); 1300Assert.Same(item, e.Item); 1313Assert.Same(item, e.Item); 1382Assert.Same(item, e.Item); 1391Assert.Same(item, e.Item); 1404Assert.Same(item, e.Item);
System\Windows\Forms\ToolStripItemImageRenderEventArgsTests.cs (3)
66Assert.Equal(item, e.Item); 84Assert.Equal(item, e.Item); 105Assert.Equal(item, e.Item);
System\Windows\Forms\ToolStripItemRenderEventArgsTests.cs (1)
47Assert.Equal(item, e.Item);
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
26Assert.Equal(item, e.Item); 52Assert.Equal(item, e.Item);
System\Windows\Forms\ToolStripSeparatorRenderEventArgsTests.cs (1)
41Assert.Equal(separator, e.Item);
System\Windows\Forms\ToolStripSeparatorTests.cs (2)
1237Assert.Same(item, e.Item); 1308Assert.Same(item, e.Item);