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