2 writes to Button
System.Windows.Forms (2)
System\Windows\Forms\Input\MouseEventArgs.cs (2)
19
Button
= button;
31
Button
= button;
128 references to Button
System.Windows.Forms (78)
System\Windows\Forms\Controls\Buttons\Button.cs (1)
220
if (mevent.
Button
== MouseButtons.Left && MouseIsPressed)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (2)
869
if (mevent.
Button
!= MouseButtons.None && GetFlag(FlagMousePressed))
900
if (mevent.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
488
if (mevent.
Button
== MouseButtons.Left
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
469
if (mevent.
Button
== MouseButtons.Left
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (23)
5756
e.
Button
,
5783
&& e.
Button
== _lastMouseClickInfo.Button
5793
e.
Button
,
5820
if (e.
Button
== MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count)
5853
e.
Button
,
5881
if (e.
Button
== MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count)
5889
if (e.
Button
== MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count)
5923
e.
Button
,
11898
if (!_dataGridViewState2[State2_MessageFromEditingCtrls] && e.
Button
== MouseButtons.Left)
11942
if (!_dataGridViewState2[State2_MessageFromEditingCtrls] && e.
Button
== MouseButtons.Left)
12668
&& e.
Button
== MouseButtons.Left
13452
if (!e.Handled && e.
Button
== MouseButtons.Left && e.ColumnIndex < Columns.Count)
13627
if (e.
Button
== MouseButtons.Left
14938
&& me.
Button
== MouseButtons.Left)
15859
&& (e.
Button
!= MouseButtons.Left
15877
if (e.
Button
== MouseButtons.Left)
15988
e.
Button
,
16008
e.
Button
,
16038
e.
Button
,
16058
e.
Button
,
16348
MouseEventArgs meTmp = new(e.
Button
, 2, e.X, e.Y, e.Delta);
17604
if (!e.Handled && e.
Button
== MouseButtons.Left && e.RowIndex < Rows.Count)
25389
_lastMouseClickInfo.Button = dgvcme.
Button
;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (4)
446
e.
Button
== MouseButtons.Left;
455
e.
Button
== MouseButtons.Left;
517
if (e.
Button
== MouseButtons.Left && s_mouseInContentBounds)
593
if (e.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
3038
if (e.
Button
== MouseButtons.Left && GetContentBounds(e.RowIndex).Contains(x, y))
System\Windows\Forms\Controls\DataGridView\DataGridViewCellMouseEventArgs.cs (1)
14
: base(e?.
Button
?? MouseButtons.None, e?.Clicks ?? 0, localX, localY, e?.Delta ?? 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
761
protected override bool MouseDownUnsharesRow(DataGridViewCellMouseEventArgs e) => e.
Button
== MouseButtons.Left;
771
protected override bool MouseUpUnsharesRow(DataGridViewCellMouseEventArgs e) => e.
Button
== MouseButtons.Left;
866
if (e.
Button
== MouseButtons.Left && s_mouseInContentBounds)
942
if (e.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnDividerDoubleClickEventArgs.cs (1)
9
: base(e?.
Button
?? MouseButtons.None, e?.Clicks ?? 0, e?.X ?? 0, e?.Y ?? 0, e?.Delta ?? 0, e?.Handled ?? false)
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (4)
429
DataGridView is not null && e.
Button
== MouseButtons.Left && DataGridView.ApplyVisualStylesToHeaderCells;
441
DataGridView is not null && e.
Button
== MouseButtons.Left && DataGridView.ApplyVisualStylesToHeaderCells;
450
if (e.
Button
== MouseButtons.Left &&
508
if (e.
Button
== MouseButtons.Left && DataGridView.ApplyVisualStylesToHeaderCells)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (1)
579
if (ptCurrentCell.X == e.ColumnIndex && ptCurrentCell.Y == e.RowIndex && e.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
888
OnLinkClicked(new LinkLabelLinkClickedEventArgs(clicked, e.
Button
));
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (3)
2402
OnMouseMove(new MouseEventArgs(e.
Button
, e.Clicks, newPoint.X, newPoint.Y, e.Delta));
2418
OnMouseDown(new MouseEventArgs(e.
Button
, e.Clicks, newPoint.X, newPoint.Y, e.Delta));
2770
if (target is not null && me.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
2951
if (e.
Button
== MouseButtons.Left && SplitterInside(e.X) && TotalProperties != 0)
2990
if (e.
Button
== MouseButtons.Left)
2992
gridEntry.OnMouseClick(e.X - r.X, e.Y - r.Y, e.Clicks, e.
Button
);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
392
if (e.
Button
== MouseButtons.Left)
494
if (e.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
813
if (e.
Button
== MouseButtons.Left && e.Clicks == 1)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
1472
if (mevent is not null && mevent.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
3333
mea = new MouseEventArgs(mea.
Button
, mea.Clicks, itemRelativePoint.X, itemRelativePoint.Y, mea.Delta);
3389
mea = new MouseEventArgs(mea.
Button
, mea.Clicks, itemRelativePoint.X, itemRelativePoint.Y, mea.Delta);
3433
mea = new MouseEventArgs(mea.
Button
, mea.Clicks, itemRelativePoint.X, itemRelativePoint.Y, mea.Delta);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
132
(e.
Button
== MouseButtons.Left))
153
(e.
Button
== MouseButtons.Left))
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
2553
if (e.
Button
== MouseButtons.Left)
2581
if (e.
Button
== MouseButtons.Left || (e.
Button
== MouseButtons.Right && _state[s_stateSupportsRightClick]))
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (2)
871
if (e.
Button
== MouseButtons.Left ||
872
(e.
Button
== MouseButtons.Right && SupportsRightClick))
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
423
if (e.
Button
== MouseButtons.Left)
450
if (e.
Button
== MouseButtons.Left)
467
if ((e.
Button
== MouseButtons.Left) && SplitButtonButton.Bounds.Contains(clickPoint))
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
681
if (e.Clicks == 2 && e.
Button
== MouseButtons.Left)
694
if (mevent.
Button
== MouseButtons.Left)
911
return new MouseEventArgs(e.
Button
, e.Clicks, point.X, point.Y, e.Delta);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (4)
116
if (!_parent.ValidationCancelled && e.
Button
== MouseButtons.Left)
121
if (e.Clicks == 2 && e.
Button
== MouseButtons.Left)
213
if (!_parent.ValidationCancelled && e.
Button
== MouseButtons.Left)
224
if (e.
Button
== MouseButtons.Left)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownEdit.cs (2)
44
if (e.Clicks == 2 && e.
Button
== MouseButtons.Left)
64
if (e.
Button
== MouseButtons.Left)
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
1142
if (e.
Button
== MouseButtons.Left && e.Clicks == 1 && !IsSplitterFixed)
System.Windows.Forms.Design (20)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
258
if (e.
Button
== MouseButtons.Left)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (2)
25
if (e.
Button
== MouseButtons.Left)
47
if (e.
Button
== MouseButtons.Left)
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
157
if (e.
Button
== MouseButtons.Left)
System\Drawing\Design\ColorEditor.ColorPalette.cs (4)
308
if (me.
Button
== MouseButtons.Left)
322
if (me.
Button
== MouseButtons.Left && Bounds.Contains(me.X, me.Y))
337
if (me.
Button
== MouseButtons.Left)
347
else if (me.
Button
== MouseButtons.Right)
System\Windows\Forms\Design\ComponentTray.cs (8)
1232
if (e.
Button
== MouseButtons.Left && _toolboxService is not null)
1263
if (e.
Button
== MouseButtons.Left)
1330
if (_mouseDragStart != InvalidPoint && e.
Button
== MouseButtons.Left)
2158
if (me.
Button
== MouseButtons.Left)
2691
return _hitTestedGlyph.Behavior.OnMouseDoubleClick(_hitTestedGlyph, e.
Button
, new Point(e.X, e.Y));
2705
return _hitTestedGlyph.Behavior.OnMouseDown(_hitTestedGlyph, e.
Button
, new Point(e.X, e.Y));
2719
return _hitTestedGlyph.Behavior.OnMouseMove(_hitTestedGlyph, e.
Button
, new Point(e.X, e.Y));
2733
return _hitTestedGlyph.Behavior.OnMouseUp(_hitTestedGlyph, e.
Button
);
System\Windows\Forms\Design\SelectionUIService.cs (2)
534
else if (hitTest != SelectionUIItem.NOHIT && me.
Button
== MouseButtons.Left)
735
if (me.
Button
== MouseButtons.Right && oldContainerDrag is not null && !oldDragMoved)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
461
if (e.
Button
== MouseButtons.Right)
1152
if (e.
Button
== MouseButtons.Right)
System.Windows.Forms.Tests (28)
System\Windows\Forms\ButtonBaseTests.cs (4)
8881
Assert.Equal(expectedButton, e.
Button
);
8917
Assert.Equal(expectedButton, e.
Button
);
8987
Assert.Equal(expectedButton, e.
Button
);
9031
Assert.Equal(expectedButton, e.
Button
);
System\Windows\Forms\ControlTests.Methods.cs (8)
13476
Assert.Equal(expectedButton, e.
Button
);
13512
Assert.Equal(expectedButton, e.
Button
);
13586
Assert.Equal(expectedButton, e.
Button
);
13630
Assert.Equal(expectedButton, e.
Button
);
13811
Assert.Equal(expectedButton, e.
Button
);
13847
Assert.Equal(expectedButton, e.
Button
);
13917
Assert.Equal(expectedButton, e.
Button
);
13961
Assert.Equal(expectedButton, e.
Button
);
System\Windows\Forms\DataGridViewCellMouseEventArgsTests.cs (2)
23
Assert.Equal(mouseE.
Button
, e.
Button
);
System\Windows\Forms\DataGridViewColumnDividerDoubleClickEventArgsTests.cs (2)
22
Assert.Equal(mouseE.
Button
, e.
Button
);
System\Windows\Forms\DataGridViewRowDividerDoubleClickEventArgsTests.cs (2)
22
Assert.Equal(mouseE.
Button
, e.
Button
);
System\Windows\Forms\HandledMouseEventArgsTests.cs (2)
18
Assert.Equal(button, e.
Button
);
34
Assert.Equal(button, e.
Button
);
System\Windows\Forms\MouseEventArgsTests.cs (1)
18
Assert.Equal(button, e.
Button
);
System\Windows\Forms\TreeNodeMouseClickEventArgsTests.cs (1)
24
Assert.Equal(button, e.
Button
);
TextBoxBaseTests.cs (6)
5619
Assert.Equal(eventArgs is not null && eventArgs.
Button
== MouseButtons.Left, control.IsHandleCreated);
5627
Assert.Equal(eventArgs is not null && eventArgs.
Button
== MouseButtons.Left, control.IsHandleCreated);
7264
Assert.Equal(expectedButton, e.
Button
);
7300
Assert.Equal(expectedButton, e.
Button
);
7374
Assert.Equal(expectedButton, e.
Button
);
7418
Assert.Equal(expectedButton, e.
Button
);
System.Windows.Forms.UI.IntegrationTests (2)
DragDropTests.cs (2)
684
_testOutputHelper.WriteLine($"Mouse move on drag source to position ({e.X},{e.Y}) with buttons {e.
Button
}.");
685
if ((e.
Button
& MouseButtons.Left) == MouseButtons.Left)