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