175 writes to X
System.Drawing.Primitives (1)
System\Drawing\Point.cs (1)
155
X
+= dx;
System.Windows.Forms (104)
System\Resources\ResXResourceReader.cs (1)
333
pt.
X
= lineInfo.LinePosition;
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (4)
130
pt.
X
+= EndOfLineWidth; // add 2 px to show the end of line
143
pt.
X
+= size.Width;
288
clientLocation.
X
= Math.Max(clientLocation.X, clientRectangle.left);
289
clientLocation.
X
= Math.Min(clientLocation.X, clientRectangle.right);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (3)
283
s_logPixels.
X
= PInvokeCore.GetDeviceCaps(dc, GET_DEVICE_CAPS_INDEX.LOGPIXELSX);
771
X
= (LogPixels.X * x + HiMetricPerInch / 2) / HiMetricPerInch,
1350
X
= (HiMetricPerInch * x + (LogPixels.X >> 1)) / LogPixels.X,
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (4)
185
pt.
X
+= EndOfLineWidth; // add 2 px to show the end of line
198
pt.
X
+= size.Width;
361
clientLocation.
X
= Math.Max(clientLocation.X, clientRectangle.left);
362
clientLocation.
X
= Math.Min(clientLocation.X, clientRectangle.right);
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (2)
152
middle.
X
-= (dropDownRect.Width % 2);
157
middle.
X
+= (dropDownRect.Width % 2);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
2362
ptFirstDisplayedCellAddress.
X
= FirstDisplayedColumnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (19)
12612
_ptMouseEnteredCell.
X
= e.ColumnIndex;
12635
_ptMouseEnteredCell.
X
= -2;
16118
_ptMouseDownCell.
X
= hti._col;
16169
_ptMouseEnteredCell.
X
= _ptMouseEnteredCell.Y = -2;
17398
_ptCurrentCellCache.
X
= -1;
17409
_ptCurrentCellCache.
X
= _ptCurrentCell.X;
17417
_ptCurrentCellCache.
X
= -1;
18818
pt.
X
+= Width;
25846
_ptMouseDownCell.
X
= -2;
26625
_ptAnchorCell.
X
= dataGridViewColumn.Index;
26630
_ptAnchorCell.
X
= -1;
26791
_ptCurrentCell.
X
= columnIndex;
26925
_ptCurrentCell.
X
= columnIndex;
26935
_ptAnchorCell.
X
= columnIndex;
26997
_ptAnchorCell.
X
= columnIndex;
27085
_ptCurrentCell.
X
= -1;
27092
_ptAnchorCell.
X
= -1;
28223
_ptCurrentCellCache.
X
= _ptCurrentCell.X;
29204
_ptMouseEnteredCell.
X
= _ptMouseEnteredCell.Y = -2;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
2154
middle.
X
+= (dropRect.Width % 2);
2178
middle.
X
+= ((dropRect.Width + 1) % 2);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (9)
392
ptTextLocation.
X
= cellBounds.X;
397
ptTextLocation.
X
= cellBounds.X + (cellBounds.Width - sizeText.Width) / 2;
402
ptTextLocation.
X
= cellBounds.Right - sizeText.Width;
407
ptTextLocation.
X
= cellBounds.X;
412
ptTextLocation.
X
= cellBounds.X + (cellBounds.Width - sizeText.Width) / 2;
417
ptTextLocation.
X
= cellBounds.Right - sizeText.Width;
422
ptTextLocation.
X
= cellBounds.X;
427
ptTextLocation.
X
= cellBounds.X + (cellBounds.Width - sizeText.Width) / 2;
432
ptTextLocation.
X
= cellBounds.Right - sizeText.Width;
System\Windows\Forms\Controls\ListView\ListView.cs (1)
2208
lvhi.pt.
X
+= si.nPos;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
1423
location.
X
= Math.Min(
1661
pt.
X
= RowValue;
3809
location.
X
-= overhang;
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (4)
126
clientLocation.
X
= Math.Max(clientLocation.X, clientRectangle.left);
127
clientLocation.
X
= Math.Min(clientLocation.X, clientRectangle.right);
334
pt.
X
+= EndOfLineWidth; // add 2 px to show the end of line
347
pt.
X
+= size.Width;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
379
noMansLand.
X
+= ClientSize.Width + 1;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
4513
cursorLocation.
X
+= currentCursor.HotSpot.X + 1;
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (1)
145
middle.
X
+= (dropDownRect.Width % 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
1025
offset.
X
= -dropDownBounds.Width;
1036
offset.
X
= -dropDownBounds.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (5)
307
offset.
X
= -dropDownBounds.Width + Width;
317
offset.
X
= -dropDownBounds.Width + Width;
321
offset.
X
= Width;
325
offset.
X
--;
331
offset.
X
= -dropDownBounds.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (4)
367
nextPoint.
X
= _checkRectangle.Right + _checkPadding.Right + _imagePadding.Left;
409
nextPoint.
X
= checkAndImageMarginWidth + 1;
419
nextPoint.
X
= _imageMarginBounds.Right + _textPadding.Left;
424
nextPoint.
X
= _textRectangle.Right + _textPadding.Right + _arrowPadding.Left;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
3456
toPoint.
X
+= currentToolStripItemLocation.X;
3468
fromPoint.
X
+= currentToolStripItemLocation.X;
3483
fromPoint.
X
-= currentToolStripItemLocation.X;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (2)
958
cursorLoc.
X
+= toolStripToDrag.GripRectangle.Width / 2;
964
cursorLoc.
X
= Cursor.Position.X;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (5)
1274
start.
X
= overflowBoundsFill.Right + 1;
1275
end.
X
= overflowBoundsFill.Right;
1303
top1.
X
= overflowBoundsFill.Right + 1;
1304
top2.
X
= overflowBoundsFill.Right;
1651
middle.
X
+= dropDownRect.Width % 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (2)
193
_noMansLand.
X
+= ToolStrip.ClientSize.Width + 1;
473
itemLocation.
X
= bounds.X;
System\Windows\Forms\Controls\WebBrowser\WebBrowser.WebBrowserSite.cs (1)
48
pt->
X
= -1;
System\Windows\Forms\Form.cs (10)
921
loc.
X
-= screen.X;
3935
p.
X
= (ownerRect.left + ownerRect.right - s.Width) / 2;
3938
p.
X
= screenRect.X;
3942
p.
X
= screenRect.X + screenRect.Width - s.Width;
3989
p.
X
= Math.Max(screenRect.X, screenRect.X + (screenRect.Width - Width) / 2);
6871
mmi->ptMinTrackSize.
X
= minTrack.Width;
6894
mmi->ptMaxTrackSize.
X
= int.MaxValue;
6903
mmi->ptMaxTrackSize.
X
= Math.Max(maxTrack.Width, minTrackWindowSize.Width);
6909
mmi->ptMaxPosition.
X
= maximizedBounds.X;
6911
mmi->ptMaxSize.
X
= maximizedBounds.Width;
System\Windows\Forms\Layout\DefaultLayout.cs (1)
89
location.
X
-= newSize.Width - oldBounds.Width;
System\Windows\Forms\Layout\FlowLayout.cs (1)
237
location.
X
+= requiredSize.Width;
System\Windows\Forms\Layout\LayoutUtils.cs (1)
436
(point.Y, point.
X
) = (point.X, point.Y);
System\Windows\Forms\Printing\PrintPreviewControl.cs (8)
619
_position.
X
= _hScrollBar.Value;
628
offset.
X
-= Position.X;
643
lastImageSize.
X
= 0;
667
lastImageSize.
X
+= imagePixels.Width;
935
locPos.
X
= pos;
969
locPos.
X
= pos;
1047
locPos.
X
= pos;
1067
locPos.
X
= pos;
System\Windows\Forms\ToolTip\ToolTip.cs (3)
1333
p.
X
= visibleRect.left + visibleRect.Width / 2;
1935
moveToLocation.
X
= screen.WorkingArea.Right - tipSize.Width;
1940
moveToLocation.
X
= screen.WorkingArea.Left;
System.Windows.Forms.Design (58)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
249
middle.
X
+= (dropDownRect.Width % 2);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (2)
347
editorLocation.
X
= Math.Min(rectScreen.Right - dropDownSize.Width, // min = right screen edge clip
371
editorLocation.
X
= Math.Min(rectScreen.Right - dropDownSize.Width, // min = right screen edge clip
System\Drawing\Design\ColorEditor.ColorPalette.cs (4)
285
SetFocus(_focus with {
X
= _focus.X - 1 });
288
SetFocus(_focus with {
X
= _focus.X + 1 });
441
newFocus.
X
= 0;
451
newFocus.
X
= CellsAcross - 1;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
276
pt.
X
-= c.Width;
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (3)
137
topRight.
X
+= relatedControl.Width;
155
topRight.
X
= newRect.Right;
159
topRight.
X
-= (GlyphImageOpened.Width + CONTROLOVERLAP_X);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
697
offset.
X
= FindSmallestValidDistance(_verticalSnapLines, _verticalDistances, minRange, maxRange, directionOffset.X);
704
offset.
X
*= -1;
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (4)
151
offset.
X
= _parentGridSize.Width - xDelta;
155
offset.
X
= -xDelta;
776
newPosition.
X
+= _lastSnapOffset.X;
790
newPosition.
X
+= _lastSnapOffset.X;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (2)
275
_parentLocation.
X
-= control.Location.X;
610
mouseLoc.
X
+= _lastSnapOffset.X;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (5)
130
offset.
X
= _lastRectangle.Left - mouseLoc.X;
136
offset.
X
= _lastRectangle.Right - mouseLoc.X;
188
offset.
X
= _lastRectangle.Left - mouseLoc.X;
194
offset.
X
= _lastRectangle.Right - mouseLoc.X;
213
offset.
X
= _lastRectangle.Left - mouseLoc.X;
System\Windows\Forms\Design\CommandSet.cs (20)
1059
loc.
X
= primaryLocation.X + primarySize.Width - size.Width;
1067
loc.
X
= primarySize.Width / 2 + primaryLocation.X - size.Width / 2;
1076
loc.
X
= primaryLocation.X;
1191
loc.
X
-= delta;
1195
loc.
X
+= (gridSize.Width - delta);
1350
loc.
X
+= deltaX;
1352
loc.
X
-= deltaX;
2432
loc.
X
= (loc.X / grid.Width) * grid.Width;
2799
curLoc.
X
= lastLoc.X + lastSize.Width;
2805
curLoc.
X
-= grid.Width * (n - primaryIndex);
2807
curLoc.
X
= primaryLoc.X;
2811
curLoc.
X
+= grid.Width * (primaryIndex - n);
2813
curLoc.
X
= primaryLoc.X;
2820
curLoc.
X
+= grid.Width * (n - primaryIndex);
2824
curLoc.
X
-= grid.Width * (primaryIndex - n);
2829
curLoc.
X
= lastLoc.X + lastSize.Width + nEqualDelta;
3253
min.
X
= loc.X;
3263
max.
X
= loc.X + size.Width;
3292
parentOffset.
X
-= (max.X - min.X) / 2;
3385
parentOffset.
X
= 0;
System\Windows\Forms\Design\ComponentTray.cs (3)
1311
_mouseDragEnd.
X
= e.X;
1825
_whiteSpace.
X
= _whiteSpace.X * 2 + 3;
1865
newLoc.
X
= _whiteSpace.X;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
806
controlOffset.
X
+= Control.Width;
System\Windows\Forms\Design\SelectionUIHandler.cs (2)
253
adjustedLoc.
X
= ctlBounds.lastRequestedX;
391
adjustedLoc.
X
= newBounds.X;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (6)
471
newControlPosition.
X
= 0;
479
newControlPosition.
X
= Table.ColumnCount - 1;
982
position.
X
= columns.Length;
991
position.
X
= i;
1005
position.
X
= columns.Length;
1012
position.
X
= i;
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
530
X
= e.X,
573
X
= e.X,
System.Windows.Forms.Primitives (3)
System\Windows\Forms\Automation\UiaTextRange.cs (3)
796
lineStartPoint.
X
-= UiaTextProvider.EndOfLineWidth;
851
lineStartPoint.
X
= minX;
852
lineEndPoint.
X
= maxX;
System.Windows.Forms.Tests (4)
System\Windows\Forms\DataObjectTests.cs (1)
2824
Point point = new() {
X
= 1, Y = 1 };
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
715
position.
X
--;
System\Windows\Forms\ToolStripDropDownTests.cs (1)
1933
expected.
X
= Math.Max(expected.X, SystemInformation.WorkingArea.X);
System\Windows\Forms\TreeNode.IKeyboardToolTipTests.cs (1)
386
position.
X
--;
System.Windows.Forms.UI.IntegrationTests (5)
DragDropTests.cs (2)
198
X
= (startCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2),
203
X
= (endCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2),
RichTextBoxTests.cs (3)
40
pt.
X
+= 2;
100
pt.
X
+= 2;
161
pt.
X
+= 2;
1727 references to X
PresentationUI (1)
MS\Internal\Documents\DialogDivider.cs (1)
53
base.SetBoundsCore(Parent.Location.
X
, y, Parent.Size.Width, 1, specified);
System.ComponentModel.TypeConverter (2)
System\Drawing\PointConverter.cs (2)
70
string? x = intConverter.ConvertToString(context, culture, pt.
X
);
80
return new InstanceDescriptor(ctor, new object[] { pt.
X
, pt.Y });
System.Drawing.Common.Tests (11)
mono\System.Drawing\GraphicsTests.cs (1)
2952
Assert.Equal(i, pts[i].
X
);
System\Drawing\RegionTests.cs (10)
1396
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y));
1397
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, s_graphic));
1398
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, disposedGraphics));
1399
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, null));
1401
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, s_graphic));
1402
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, disposedGraphics));
1403
Assert.Equal(expected, region.IsVisible(point.
X
, point.Y, null));
1404
Assert.Equal(expected, region.IsVisible((float)point.
X
, point.Y, s_graphic));
1405
Assert.Equal(expected, region.IsVisible((float)point.
X
, point.Y, disposedGraphics));
1406
Assert.Equal(expected, region.IsVisible((float)point.
X
, point.Y, null));
System.Drawing.Primitives (16)
System\Drawing\Point.cs (11)
79
public static implicit operator PointF(Point p) => new PointF(p.
X
, p.Y);
84
public static explicit operator Size(Point p) => new Size(p.
X
, p.Y);
98
/// <see cref='System.Drawing.Point.
X
'/> and <see cref='System.Drawing.Point.Y'/> properties of the two
101
public static bool operator ==(Point left, Point right) => left.
X
== right.
X
&& left.Y == right.Y;
105
/// <see cref='System.Drawing.Point.
X
'/> or <see cref='System.Drawing.Point.Y'/> properties of the two
113
public static Point Add(Point pt, Size sz) => new Point(unchecked(pt.
X
+ sz.Width), unchecked(pt.Y + sz.Height));
118
public static Point Subtract(Point pt, Size sz) => new Point(unchecked(pt.
X
- sz.Width), unchecked(pt.Y - sz.Height));
146
public override readonly int GetHashCode() => HashCode.Combine(
X
, Y);
163
public void Offset(Point p) => Offset(p.
X
, p.Y);
168
public override readonly string ToString() => $"{{X={
X
},Y={Y}}}";
System\Drawing\Rectangle.cs (4)
41
x = location.
X
;
63
X = value.
X
;
229
public readonly bool Contains(Point pt) => Contains(pt.
X
, pt.Y);
326
public void Offset(Point pos) => Offset(pos.
X
, pos.Y);
System\Drawing\Size.cs (1)
31
width = pt.
X
;
System.Private.Windows.Core (2)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
146
value.
X
,
Windows\Win32\Foundation\LPARAM.cs (1)
28
public static explicit operator LPARAM(Point value) => MAKELPARAM(value.
X
, value.Y);
System.Windows.Forms (1083)
System\Resources\ResXDataNode.cs (4)
375
string newMessage = string.Format(SR.NotSupported, typeName, dataNodeInfo.ReaderPosition.Y, dataNodeInfo.ReaderPosition.
X
, nse.Message);
376
XmlException xml = new(newMessage, nse, dataNodeInfo.ReaderPosition.Y, dataNodeInfo.ReaderPosition.
X
);
388
dataNodeInfo.ReaderPosition.
X
);
392
new XmlException(newMessage, null, dataNodeInfo.ReaderPosition.Y, dataNodeInfo.ReaderPosition.
X
));
System\Resources\ResXResourceReader.cs (5)
379
string newMessage = string.Format(SR.SerializationException, reader[ResXResourceWriter.TypeStr], pt.Y, pt.
X
, se.Message);
380
XmlException xml = new(newMessage, se, pt.Y, pt.
X
);
386
string newMessage = string.Format(SR.InvocationException, reader[ResXResourceWriter.TypeStr], pt.Y, pt.
X
, tie.InnerException?.Message);
387
XmlException xml = new(newMessage, tie.InnerException, pt.Y, pt.
X
);
403
XmlException xmlEx = new(e.Message, e, pt.Y, pt.
X
);
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (2)
288
clientLocation.X = Math.Max(clientLocation.
X
, clientRectangle.left);
289
clientLocation.X = Math.Min(clientLocation.
X
, clientRectangle.right);
System\Windows\Forms\ActiveX\AxHost.cs (3)
1096
sz.Width = phm.
X
;
3259
Bounds = new Rectangle(location.
X
, location.Y, ocxExtent.Width, ocxExtent.Height);
3266
Bounds = new Rectangle(location.
X
, location.Y, newSize.Width, newSize.Height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (8)
466
PInvoke.SetViewportOrgEx(hdcDraw, p1.
X
, p1.Y, &pVp);
467
PInvoke.SetViewportExtEx(hdcDraw, p2.
X
, p2.Y, (SIZE*)&sViewportExt);
488
PInvoke.SetWindowOrgEx(hdcDraw, pW.
X
, pW.Y, lppt: null);
490
PInvoke.SetViewportOrgEx(hdcDraw, pVp.
X
, pVp.Y, lppt: null);
701
pSizel->Width = pt.
X
;
771
X = (LogPixels.
X
* x + HiMetricPerInch / 2) / HiMetricPerInch,
1350
X = (HiMetricPerInch * x + (LogPixels.
X
>> 1)) / LogPixels.
X
,
System\Windows\Forms\Control.cs (7)
1564
if ((r.left <= p.
X
&& p.
X
< r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND)
2490
set => SetBounds(value.
X
, value.Y, _width, _height, BoundsSpecified.Location);
7985
cliprect.Offset(-offs.
X
, -offs.Y);
8783
viewportOrg.
X
,
8785
viewportOrg.
X
+ Width,
8812
clientOffset = new(clientOffset.
X
- windowRect.left, clientOffset.Y - windowRect.top);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
400
imageBounds.X = imageStart.
X
+ 1;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (2)
361
clientLocation.X = Math.Max(clientLocation.
X
, clientRectangle.left);
362
clientLocation.X = Math.Min(clientLocation.
X
, clientRectangle.right);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (8)
1594
OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1, Ptlc.
X
, Ptlc.Y, 0));
1611
OnMouseDown(new MouseEventArgs(MouseButtons.Middle, 1, Ptmc.
X
, Ptmc.Y, 0));
1628
OnMouseDown(new MouseEventArgs(MouseButtons.Right, 1, Ptrc.
X
, Ptrc.Y, 0));
1642
OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1, Ptl.
X
, Ptl.Y, 0));
1687
OnMouseDown(new MouseEventArgs(MouseButtons.Middle, 1, P.
X
, P.Y, 0));
1704
OnMouseDown(new MouseEventArgs(MouseButtons.Right, 1, Pt.
X
, Pt.Y, 0));
1724
OnMouseUp(new MouseEventArgs(MouseButtons.Right, 1, ptRBtnUp.
X
, ptRBtnUp.Y, 0));
1746
OnMouseMove(new MouseEventArgs(MouseButtons, 0, point.
X
, point.Y, 0));
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (3)
164
new(middle.
X
- s_offsetPixels, middle.Y - 1),
165
new(middle.
X
+ s_offsetPixels + 1, middle.Y - 1),
166
new(middle.
X
, middle.Y + s_offsetPixels)
System\Windows\Forms\Controls\DataGridView\DataGridView.AccessibleObject.cs (1)
161
HitTestInfo hti = owner.HitTest(pt.
X
, pt.Y);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (25)
1131
if (_ptCurrentCell.
X
!= -1 && ColumnEditable(_ptCurrentCell.
X
))
1708
if (_ptCurrentCell.
X
== -1 && _ptCurrentCell.Y == -1)
1713
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.Y >= 0);
1714
Debug.Assert(_ptCurrentCell.
X
< Columns.Count);
1717
return dataGridViewRow.Cells[_ptCurrentCell.
X
];
1721
if ((value is not null && (value.RowIndex != _ptCurrentCell.Y || value.ColumnIndex != _ptCurrentCell.
X
))
1722
|| (value is null && _ptCurrentCell.
X
!= -1))
1782
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.
X
< Columns.Count);
1786
DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[_ptCurrentCell.
X
];
1796
if (_ptCurrentCell.
X
== -1)
1803
bool previousVisibleColumnExists = (Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1814
if (_ptCurrentCell.
X
== -1)
1821
bool nextVisibleColumnExists = (Columns.GetNextColumn(Columns[_ptCurrentCell.
X
], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1832
if (_ptCurrentCell.
X
== -1)
1850
if (_ptCurrentCell.
X
== -1)
2287
if (firstDisplayedCellAddress.
X
>= 0)
2289
return Rows[firstDisplayedCellAddress.Y].Cells[firstDisplayedCellAddress.
X
]; // un-shares the row of first displayed cell
2488
if (_ptCurrentCell.
X
>= 0
2568
if (_ptCurrentCell.
X
>= 0
2745
&& !Columns[_ptCurrentCell.
X
].Frozen
2850
=> _ptCurrentCell.
X
== -1 ? null : CurrentCellInternal.GetInheritedStyleInternal(_ptCurrentCell.Y);
3071
if (value && _ptCurrentCell.
X
!= -1 && IsCurrentCellInEditMode)
3143
if (_ptCurrentCell.
X
!= -1 && !SetCurrentCellAddressCore(
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (4)
681
Debug.Assert(_owner.CurrentCellAddress.
X
== -1);
1216
int columnIndex = _owner.CurrentCellAddress.
X
== -1 ? _owner.FirstDisplayedColumnIndex : _owner.CurrentCellAddress.
X
;
1261
if (rowIndex == _owner.CurrentCellAddress.Y && columnIndex == _owner.CurrentCellAddress.
X
)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (683)
22
if (cellAddress.
X
< 0 || cellAddress.
X
>= Columns.Count)
33
int visibleColumnIndex = Columns.ColumnIndexToActualDisplayIndex(cellAddress.
X
, DataGridViewElementStates.Visible);
2564
public virtual bool BeginEdit(bool selectAll) => _ptCurrentCell.
X
== -1
2578
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.
X
< Columns.Count);
2585
if (IsSharedCellReadOnly(dataGridViewCell, _ptCurrentCell.Y) || !ColumnEditable(_ptCurrentCell.
X
))
2601
DataGridViewCellCancelEventArgs dgvcce = new(_ptCurrentCell.
X
, _ptCurrentCell.Y);
2610
if (_ptCurrentCell.
X
> -1)
2618
if (IsSharedCellReadOnly(dataGridViewCell, _ptCurrentCell.Y) || !ColumnEditable(_ptCurrentCell.
X
))
2722
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
3041
if (_ptCurrentCell.
X
!= -1)
3045
int oldCurrentCellX = _ptCurrentCell.
X
;
3103
_ptCurrentCell.
X
,
3129
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
3133
else if (_ptCurrentCell.
X
== -1 && Focused)
3203
int oldCurrentCellX = _ptCurrentCell.
X
;
3208
if (currentCellDirty || _ptCurrentCell.Y == -1 || _ptCurrentCell.
X
== -1)
3307
if (_ptCurrentCell.
X
> -1)
3422
if (_ptCurrentCell.
X
!= -1 && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
3424
InvalidateCellPrivate(_ptCurrentCell.
X
, -1);
3760
Debug.Assert(_ptCurrentCell.
X
> -1);
3763
if (_ptCurrentCell.
X
== -1)
3768
OnCellLeave(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3773
if (_ptCurrentCell.
X
== -1)
3778
OnRowLeave(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3789
if (_ptCurrentCell.
X
> -1 && _ptCurrentCell.Y > -1)
3791
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
3799
if (_ptCurrentCell.
X
== -1)
3804
if (OnCellValidating(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y, context))
3808
if (_ptCurrentCell.
X
== -1)
3815
_ptCurrentCell.
X
,
3823
if (_ptCurrentCell.
X
== -1)
3828
OnCellEnter(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3831
if (_ptCurrentCell.
X
== -1)
3838
_ptCurrentCell.
X
,
3849
if (_ptCurrentCell.
X
== -1)
3854
OnCellValidated(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3859
if (_ptCurrentCell.
X
== -1 || !IsCurrentCellInEditMode)
3875
Debug.Assert(_ptCurrentCell.
X
> -1);
3876
if (_ptCurrentCell.
X
== -1)
3881
if (OnCellValidating(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y, context))
3883
if (_ptCurrentCell.
X
== -1)
3890
_ptCurrentCell.
X
,
3915
if (_ptCurrentCell.
X
== -1)
3922
_ptCurrentCell.
X
,
3957
if (_ptCurrentCell.
X
== -1)
3962
OnCellValidated(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
4022
Debug.Assert(_ptCurrentCell.
X
> -1);
4023
if (_ptCurrentCell.
X
== -1)
4028
int columnIndex = _ptCurrentCell.
X
;
4086
int columnIndexTmp = _ptCurrentCell.
X
;
4158
if (forCurrentCellChange && _ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
5737
Debug.Assert(_ptCurrentCell.
X
!= -1);
5738
int adjustedX = _editingPanel.Location.
X
+ e.X;
5742
adjustedX += EditingControl.Location.
X
;
5950
Debug.Assert(_ptCurrentCell.
X
!= -1);
5960
Debug.Assert(_ptCurrentCell.
X
!= -1);
6162
if (_ptCurrentCell.
X
== -1)
6171
int curColIndex = _ptCurrentCell.
X
;
6215
if (curRowIndex != _ptCurrentCell.Y || curColIndex != _ptCurrentCell.
X
)
6239
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
6266
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
8689
if (_ptAnchorCell.
X
!= -1
8690
&& Columns[_ptAnchorCell.
X
].Frozen
8718
if (_ptAnchorCell.
X
!= -1
8719
&& (!Columns[_ptAnchorCell.
X
].Frozen || (_trackColumnEdge != -1 && !Columns[_trackColumnEdge].Frozen))
8870
if (((_ptAnchorCell.
X
!= -1 && !Columns[_ptAnchorCell.
X
].Frozen) || (_ptCurrentCell.
X
!= -1 && !Columns[_ptCurrentCell.
X
].Frozen))
9633
HitTestInfo hti = HitTest(ptMouse.
X
, ptMouse.Y);
9634
int mouseX = ptMouse.
X
, mouseY = ptMouse.Y;
9645
hti = HitTest(ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset), mouseY);
9655
ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset),
9657
: HitTest(ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset), mouseY);
9696
Debug.Assert(_ptCurrentCell.
X
== dataGridViewCell.ColumnIndex);
9697
dataGridViewCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
]; // un-share the edited cell
9707
_ptCurrentCell.
X
,
9739
_ptCurrentCell.
X
,
10110
&& _ptCurrentCell.
X
!= -1)
10390
if (firstDisplayedCellAddress.
X
!= -1
10394
firstDisplayedCellAddress.
X
,
11902
HitTestInfo hti = HitTest(ptGridCoord.
X
, ptGridCoord.Y);
11909
Debug.Assert(_ptMouseDownCell.
X
== hti._col);
11961
BeginMouseColumnResize(ptGridCoord.
X
, hti._mouseBarOffset, columnIndex);
11990
BeginColumnRelocation(ptGridCoord.
X
, hti._col);
12029
BeginRowHeadersResize(ptGridCoord.
X
, hti._mouseBarOffset);
12051
if (_ptCurrentCell.
X
== -1)
12068
if (_ptCurrentCell.
X
>= 0 && (_ptCurrentCell.
X
!= hti._col || _ptCurrentCell.Y != hti._row))
12073
forCurrentCellChange: _ptCurrentCell.
X
!= hti._col || _ptCurrentCell.Y != hti._row,
12093
if (_ptCurrentCell.
X
== -1 && dataGridViewLastVisibleColumn is not null)
12109
if (_ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
12155
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12157
if (_ptAnchorCell.
X
== -1)
12163
_ptAnchorCell.
X
,
12207
if (MultiSelect && isShiftDown && _ptAnchorCell.
X
> -1 && Columns[_ptAnchorCell.
X
].Selected)
12254
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, hti._col))
12256
SelectColumnRange(_ptAnchorCell.
X
, hti._col, true);
12260
SelectColumnRange(hti._col, _ptAnchorCell.
X
, true);
12345
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12347
if (_ptAnchorCell.
X
== -1)
12353
_ptAnchorCell.
X
,
12551
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12553
if (_ptAnchorCell.
X
== -1)
12559
_ptAnchorCell.
X
,
12680
&& _ptMouseDownCell.
X
>= 0
12681
&& _ptMouseDownCell.
X
< Columns.Count)
12685
HitTestInfo hti = HitTest(ptGridCoord.
X
, ptGridCoord.Y);
12700
if (Math.Abs(_ptMouseDownGridCoord.
X
- ptGridCoord.
X
) >= s_dragSize.Width
12703
BeginColumnRelocation(_ptMouseDownGridCoord.
X
, _ptMouseDownCell.
X
);
12765
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12767
if ((hti._col != _ptCurrentCell.
X
|| hti._row != _ptCurrentCell.Y)
12777
if (_ptAnchorCell.
X
== -1 || IsInnerCellOutOfBounds(hti._col, hti._row))
12783
_ptAnchorCell.
X
,
12790
if (hti._col != _ptCurrentCell.
X
|| hti._row != _ptCurrentCell.Y)
12824
&& _ptCurrentCell.
X
== dataGridViewCell.ColumnIndex
12832
&& ColumnEditable(_ptCurrentCell.
X
)
13700
if (rowIndex > -1 && hti._col != _ptCurrentCell.
X
)
13703
int oldCurrentCellX = _ptCurrentCell.
X
;
13769
if (MultiSelect && isShiftDown && _ptAnchorCell.
X
> -1 && Columns[_ptAnchorCell.
X
].Selected)
13825
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, hti._col))
13827
SelectColumnRange(_ptAnchorCell.
X
, hti._col, true);
13831
SelectColumnRange(hti._col, _ptAnchorCell.
X
, true);
13842
if (hti._col != _ptCurrentCell.
X
)
13864
else if (_ptCurrentCell.
X
!= -1)
13868
_ptCurrentCell.
X
,
14129
if (_ptCurrentCell.
X
!= -1 && hti._col != _ptCurrentCell.
X
&& !CommitEditForOperation(hti._col, _ptCurrentCell.Y, true))
14211
if (_ptCurrentCell.
X
!= -1 && hti._col != _ptCurrentCell.
X
)
14439
&& dataGridViewColumn.Index == _ptCurrentCell.
X
14445
&& ColumnEditable(_ptCurrentCell.
X
)
14522
PositionEditingControl(_ptCurrentCell.
X
!= e.Column.Index, true, false);
14544
if (_ptMouseDownCell.
X
== -2
14546
&& _ptMouseDownCell.
X
== columnIndex
14548
&& (_ptMouseDownCell.
X
== -1
14550
|| (columnIndex == _ptCurrentCell.
X
&& rowIndex == _ptCurrentCell.Y))))
14725
else if (dataGridViewColumn.Visible && _ptCurrentCell.
X
== dataGridViewColumn.Index)
14746
if (_ptCurrentCell.
X
== dataGridViewColumn.Index
14846
if (_ptCurrentCell.
X
== dataGridViewCell.ColumnIndex
14963
if (Focused && EditMode == DataGridViewEditMode.EditOnEnter && _ptCurrentCell.
X
> -1 && !IsCurrentCellInEditMode)
15016
if (_ptCurrentCell.
X
> -1)
15024
_ptCurrentCell.
X
,
15028
if (_ptCurrentCell.
X
== -1)
15033
OnCellEnter(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15038
InvalidateCellPrivate(_ptCurrentCell.
X
, -1);
15047
if (_ptCurrentCell.
X
> -1 && !IsCurrentCellInEditMode)
15053
if (_ptCurrentCell.
X
> -1 && CurrentCellInternal.EditType is null && !_dataGridViewOper[OperationInMouseDown])
15058
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15067
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15190
if (_ptCurrentCell.
X
!= -1)
15192
InvalidateCell(_ptCurrentCell.
X
, _ptCurrentCell.Y);
15199
&& _ptCurrentCell.
X
> -1)
15232
if (_ptCurrentCell.
X
== -1)
15238
ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, forCurrentCellChange: false);
15272
if (newCurrentCell.
X
!= -1)
15274
Debug.Assert(_ptCurrentCell.
X
== -1);
15276
newCurrentCell.
X
,
15312
Debug.Assert(_ptCurrentCell.
X
== -1);
15314
newCurrentCell.
X
,
15352
Debug.Assert(_ptCurrentCell.
X
== -1);
15354
newCurrentCell.
X
,
15411
if (_ptCurrentCell.
X
!= -1)
15413
newCurrentCell = new Point(columnIndexInserted <= _ptCurrentCell.
X
? _ptCurrentCell.
X
+ 1 : _ptCurrentCell.
X
,
15533
newCurrentCell = new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y + insertionCount);
15616
newCurrentCell = new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y + dataGridViewRows.Length);
15679
if (_ptCurrentCell.
X
!= -1)
15738
if (_ptCurrentCell.
X
!= -1)
15772
if (_ptCurrentCell.
X
!= -1)
15815
if (_ptCurrentCell.
X
> -1 && !_dataGridViewState1[State1_LeavingWithTabKey])
15818
OnCellLeave(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15819
if (_ptCurrentCell.
X
== -1)
15824
OnRowLeave(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15832
if (_ptCurrentCell.
X
> -1 && _ptCurrentCell.Y > -1)
15834
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15848
if (_ptCurrentCell.
X
!= -1)
15850
InvalidateCell(_ptCurrentCell.
X
, _ptCurrentCell.Y);
15873
if (_ptMouseDownCell.
X
== hti._col
15876
|| _ptMouseDownCell.
X
== -1
15878
|| (_ptMouseDownCell.
X
== _ptCurrentCell.
X
&& _ptMouseDownCell.Y == _ptCurrentCell.Y)))
15962
if (_ptMouseDownCell.
X
== hti._col && _ptMouseDownCell.Y == hti._row)
16105
if (_ptMouseDownCell.
X
!= -2)
16160
if (!mouseOverEditingPanel && !mouseOverEditingControl && !mouseOverToolTipControl && _ptMouseEnteredCell.
X
!= -2)
16162
if (_ptMouseEnteredCell.
X
>= -1 && _ptMouseEnteredCell.
X
< Columns.Count
16165
OnCellMouseLeave(new(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y));
16373
&& _ptMouseDownCell.
X
== hti._col
16507
if (_ptCurrentCell.
X
>= 0 && !CommitEdit(
16550
if (_ptCurrentCell.
X
>= 0 && !CommitEdit(
16859
&& _ptCurrentCell.
X
!= -1
16860
&& ColumnEditable(_ptCurrentCell.
X
)
16864
&& !Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
].ReadOnly) // Un-shares the row
16897
if (newCurrentCell.
X
!= -1)
16899
Debug.Assert(_ptCurrentCell.
X
== -1);
16901
newCurrentCell.
X
,
16950
Debug.Assert(_ptCurrentCell.
X
== -1);
16952
newCurrentCell.
X
,
17032
if (_ptCurrentCell.
X
!= -1)
17034
int newX = _ptCurrentCell.
X
;
17035
if (columnIndex == _ptCurrentCell.
X
)
17062
else if (columnIndex < _ptCurrentCell.
X
)
17064
newX = _ptCurrentCell.
X
- 1;
17068
if (columnIndex == _ptCurrentCell.
X
)
17282
newCurrentCell = new Point(_ptCurrentCell.
X
, newY);
17391
if (_ptCurrentCellCache.
X
!= -1)
17393
if (!IsInnerCellOutOfBounds(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y))
17395
SetCurrentCellAddressCore(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y, false, false, false);
17405
if (_ptCurrentCell.
X
== dataGridViewRow.Index && _ptCurrentCell.Y == columnIndex)
17409
_ptCurrentCellCache.X = _ptCurrentCell.
X
;
17550
&& _ptCurrentCell.
X
== -1
17953
int oldCurrentCellX = _ptCurrentCell.
X
;
18014
if (_ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
18147
_ptCurrentCell.
X
,
18407
&& !CommitEditForOperation(_ptCurrentCell.
X
, hti._row, forCurrentCellChange: true))
18491
bool success = SetCurrentCellAddressCore(_ptCurrentCell.
X
,
18687
&& !Columns[_ptCurrentCell.
X
].ReadOnly
18688
&& ColumnEditable(_ptCurrentCell.
X
)
18701
if (_ptCurrentCell.
X
!= -1 && dataGridViewRow.Index == _ptCurrentCell.Y && EditingControl is not null)
18813
if (pt.
X
< 0 && step < 0)
18815
Invalidate(new Rectangle(new Point(-pt.
X
, ColumnHeadersHeight), new Size(-step, ClientSize.Height)));
18823
if (pt.
X
> rect.Right && step > 0)
18825
Invalidate(new Rectangle(new Point(ClientSize.Width - (pt.
X
- rect.Right) - step, ColumnHeadersHeight),
18982
if (_ptCurrentCell.
X
!= -1)
18986
_ptCurrentCell.
X
,
19065
if (_ptCurrentCell.
X
>= 0)
19068
if (OnRowValidating(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y))
19075
if (_ptCurrentCell.
X
== -1)
19080
OnRowValidated(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y);
19083
if (DataSource is not null && _ptCurrentCell.
X
>= 0 && AllowUserToAddRowsInternal && NewRowIndex == _ptCurrentCell.Y)
19090
_ptCurrentCell.
X
,
19803
Debug.Assert(dataGridViewCell.ColumnIndex == _ptCurrentCell.
X
);
19817
int leftEdge = GetColumnXFromIndex(_ptCurrentCell.
X
);
19820
leftEdge -= Columns[_ptCurrentCell.
X
].Width - 1;
19824
Columns[_ptCurrentCell.
X
].Width, Rows.SharedRow(_ptCurrentCell.Y).GetHeight(_ptCurrentCell.Y));
19827
if (!Columns[_ptCurrentCell.
X
].Frozen)
19863
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex == _ptCurrentCell.
X
;
20075
if (_ptCurrentCell.
X
> -1
20178
if (_ptCurrentCell.
X
== -1)
20204
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20210
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20212
if (_ptCurrentCell.
X
== -1 || _ptAnchorCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20219
_ptAnchorCell.
X
,
20225
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20233
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20238
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20245
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20246
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20256
if (_ptCurrentCell.
X
== -1)
20276
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20281
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20288
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20289
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20301
if (_ptCurrentCell.
X
== -1)
20327
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20332
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20340
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20342
if (_ptAnchorCell.
X
== -1)
20349
_ptAnchorCell.
X
,
20359
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20362
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20371
if (_ptCurrentCell.
X
== -1)
20397
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, forCurrentCellChange: true))
20402
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20409
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20411
_ptCurrentCell.
X
,
20431
if (_ptCurrentCell.
X
== -1)
20453
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20458
if (_ptAnchorCell.Y == -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20467
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20475
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20480
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20488
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20498
if (_ptCurrentCell.
X
== -1)
20518
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20523
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20531
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20543
if (_ptCurrentCell.
X
== -1)
20569
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20574
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20583
if (_ptAnchorCell.
X
== -1)
20603
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20612
if (_ptCurrentCell.
X
== -1)
20638
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20643
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20651
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
20667
if (_ptCurrentCell.
X
== -1)
20689
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20708
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20711
_ptAnchorCell.
X
,
20719
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20727
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20745
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
20746
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20749
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20759
if (_ptCurrentCell.
X
== -1)
20779
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20798
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20801
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20813
if (_ptCurrentCell.
X
== -1)
20839
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20879
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20881
if (_ptAnchorCell.
X
== -1)
20888
_ptAnchorCell.
X
,
20898
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20902
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20911
if (_ptCurrentCell.
X
== -1)
20937
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20956
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20959
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
20973
if (_ptCurrentCell.
X
== -1)
20993
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20998
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21004
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
21013
if (_ptCurrentCell.
X
== -1)
21039
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
21044
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21050
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
21106
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21108
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21111
_ptAnchorCell.
X
,
21155
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21165
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21168
_ptAnchorCell.
X
,
21233
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21235
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
21272
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21277
if (_ptAnchorCell.
X
== -1)
21282
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
21289
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21291
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21293
if (_ptAnchorCell.
X
== -1)
21299
_ptAnchorCell.
X
,
21327
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21419
if (_ptCurrentCell.
X
!= -1)
21458
int columnIndex = _ptCurrentCell.
X
;
21501
if (_ptCurrentCell.
X
!= -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21507
|| !ColumnEditable(_ptCurrentCell.
X
));
21509
if (ColumnEditable(_ptCurrentCell.
X
)
21513
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, forCurrentCellChange: false);
21530
if (_ptCurrentCell.
X
!= -1)
21532
DataGridViewColumn dataGridViewColumn = Columns[_ptCurrentCell.
X
];
21580
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21582
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21585
_ptAnchorCell.
X
,
21629
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21639
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21642
_ptAnchorCell.
X
,
21707
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21709
if (_ptAnchorCell.
X
== -1)
21714
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
21751
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21756
if (_ptAnchorCell.
X
== -1)
21761
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
21768
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21770
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21772
if (_ptAnchorCell.
X
== -1)
21778
_ptAnchorCell.
X
,
21806
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21878
if (_ptCurrentCell.
X
!= -1)
21884
&& ColumnEditable(_ptCurrentCell.
X
)
21902
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
22005
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns && _ptCurrentCell.
X
!= -1)
22009
DataGridViewColumn dataGridViewColumn = Columns[_ptCurrentCell.
X
];
22014
BeginKeyboardColumnResize(_ptCurrentCell.
X
);
22041
if (CurrentCell is null || _ptCurrentCell.
X
== -1 || _ptCurrentCell.Y == -1)
22083
if (_ptCurrentCell.
X
!= -1)
22085
dataGridViewColumn = Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
],
22109
if (_ptCurrentCell.
X
== -1)
22142
Debug.Assert(_ptAnchorCell.
X
>= 0);
22143
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22145
if (_ptAnchorCell.
X
== -1)
22151
_ptAnchorCell.
X
,
22170
if (_ptCurrentCell.
X
== -1)
22220
if (_ptCurrentCell.
X
== -1)
22254
if (_ptAnchorCell.
X
== -1)
22259
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, previousVisibleColumnIndex))
22261
SelectColumnRange(_ptAnchorCell.
X
, previousVisibleColumnIndex, true);
22265
SelectColumnRange(previousVisibleColumnIndex, _ptAnchorCell.
X
, true);
22279
if (_ptCurrentCell.
X
== -1)
22329
if (_ptCurrentCell.
X
== -1)
22355
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22360
if (Columns[_ptCurrentCell.
X
].Selected)
22365
if (_ptAnchorCell.
X
== -1)
22370
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, previousVisibleColumnIndex))
22372
SelectColumnRange(_ptAnchorCell.
X
, previousVisibleColumnIndex, true);
22376
SelectColumnRange(previousVisibleColumnIndex, _ptAnchorCell.
X
, true);
22386
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22388
if (_ptAnchorCell.
X
== -1)
22394
_ptAnchorCell.
X
,
22414
if (_ptCurrentCell.
X
== -1)
22440
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22445
if (Columns[_ptCurrentCell.
X
].Selected)
22471
if (_ptCurrentCell.
X
== -1)
22533
if (_ptCurrentCell.
X
== -1)
22556
Debug.Assert(_ptAnchorCell.
X
>= 0);
22557
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22559
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22565
_ptAnchorCell.
X
,
22605
if (_ptCurrentCell.
X
== -1)
22653
if (_ptCurrentCell.
X
== -1)
22681
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22687
Debug.Assert(_ptAnchorCell.
X
>= 0);
22688
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
22699
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22704
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
22713
if (_ptCurrentCell.
X
== -1)
22751
if (_ptCurrentCell.
X
== -1)
22774
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22779
Debug.Assert(_ptAnchorCell.
X
>= 0);
22780
if (Columns[_ptCurrentCell.
X
].Selected)
22783
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
22787
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22790
_ptAnchorCell.
X
,
22808
if (_ptCurrentCell.
X
== -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
22813
if (Columns[_ptCurrentCell.
X
].Selected)
22815
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
22820
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
22831
if (_ptCurrentCell.
X
== -1)
22852
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22857
if (Columns[_ptCurrentCell.
X
].Selected)
22876
if (_ptCurrentCell.
X
== -1)
22950
if (!ScrollIntoView(_ptCurrentCell.
X
== -1 ? firstVisibleColumnIndex : _ptCurrentCell.
X
,
22988
if (_ptCurrentCell.
X
== -1)
23021
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23026
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23034
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23042
_ptAnchorCell.
X
,
23052
SetSelectedCellCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true);
23055
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, false, false, false);
23060
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23065
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23093
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, false, false, false);
23097
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23102
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23129
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23132
_ptAnchorCell.
X
,
23150
SetSelectedCellCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true);
23154
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23158
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23163
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23168
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true, false, false);
23232
_ptCurrentCell.
X
== -1 ? firstVisibleColumnIndex : _ptCurrentCell.
X
,
23248
if (_ptCurrentCell.
X
== -1)
23280
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23285
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23293
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23295
if (_ptAnchorCell.
X
== -1)
23301
_ptAnchorCell.
X
,
23311
SetSelectedCellCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true);
23314
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, false, false, false);
23318
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23323
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23351
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, false, false, false);
23355
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23360
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23387
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23390
_ptAnchorCell.
X
,
23408
SetSelectedCellCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true);
23412
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23416
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23421
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23426
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true, false, false);
23462
if (_ptCurrentCell.
X
!= -1)
23464
dataGridViewColumn = Columns.GetNextColumn(Columns[_ptCurrentCell.
X
],
23488
if (_ptCurrentCell.
X
== -1)
23521
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23523
if (_ptAnchorCell.
X
== -1)
23529
_ptAnchorCell.
X
,
23548
if (_ptCurrentCell.
X
== -1)
23598
if (_ptCurrentCell.
X
== -1)
23632
if (_ptAnchorCell.
X
== -1)
23637
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, nextVisibleColumnIndex))
23639
SelectColumnRange(_ptAnchorCell.
X
, nextVisibleColumnIndex, true);
23643
SelectColumnRange(nextVisibleColumnIndex, _ptAnchorCell.
X
, true);
23657
if (_ptCurrentCell.
X
== -1)
23707
if (_ptCurrentCell.
X
== -1)
23738
if (Columns[_ptCurrentCell.
X
].Selected)
23743
if (_ptAnchorCell.
X
== -1)
23748
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, nextVisibleColumnIndex))
23750
SelectColumnRange(_ptAnchorCell.
X
, nextVisibleColumnIndex, true);
23754
SelectColumnRange(nextVisibleColumnIndex, _ptAnchorCell.
X
, true);
23766
if (_ptAnchorCell.
X
== -1)
23771
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23774
_ptAnchorCell.
X
,
23794
if (_ptCurrentCell.
X
== -1)
23820
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23825
if (Columns[_ptCurrentCell.
X
].Selected)
23851
if (_ptCurrentCell.
X
== -1)
23913
if (_ptCurrentCell.
X
== -1)
23941
Debug.Assert(_ptAnchorCell.
X
>= 0);
23942
if (_ptAnchorCell.
X
== -1)
23947
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23950
_ptAnchorCell.
X
,
23970
if (_ptCurrentCell.
X
== -1)
24008
if (_ptCurrentCell.
X
== -1)
24036
if (_ptAnchorCell.
X
== -1)
24042
Debug.Assert(_ptAnchorCell.
X
>= 0);
24043
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
24049
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
24058
if (_ptCurrentCell.
X
== -1)
24096
if (_ptCurrentCell.
X
== -1)
24124
Debug.Assert(_ptAnchorCell.
X
>= 0);
24125
if (_ptAnchorCell.
X
== -1)
24130
if (Columns[_ptCurrentCell.
X
].Selected)
24133
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
24137
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24140
_ptAnchorCell.
X
,
24153
if (Columns[_ptCurrentCell.
X
].Selected)
24155
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
24160
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
24171
if (_ptCurrentCell.
X
== -1)
24197
if (Columns[_ptCurrentCell.
X
].Selected)
24216
if (_ptCurrentCell.
X
== -1)
24259
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift && _ptCurrentCell.
X
!= -1)
24278
if (_selectedBandIndexes[bandIndex] != _ptCurrentCell.
X
)
24290
if (!Columns[_ptCurrentCell.
X
].Selected)
24292
Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.
X
));
24293
SetSelectedColumnCore(_ptCurrentCell.
X
, true);
24558
if (_ptCurrentCell.
X
== -1)
24574
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24579
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24585
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24588
_ptAnchorCell.
X
,
24594
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
24598
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24603
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24609
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
24610
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24616
if (_ptCurrentCell.
X
== -1)
24630
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24635
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24641
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
24642
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24650
if (_ptCurrentCell.
X
== -1)
24669
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24674
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24687
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24690
_ptAnchorCell.
X
,
24700
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
24703
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
24708
if (_ptCurrentCell.
X
== -1)
24727
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24732
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24738
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, selected: true);
24740
_ptCurrentCell.
X
,
24756
if (_ptCurrentCell.
X
== -1)
24772
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24777
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24785
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
24789
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24794
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24801
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24807
if (_ptCurrentCell.
X
== -1)
24821
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24826
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24833
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24841
if (_ptCurrentCell.
X
== -1)
24860
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24865
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24892
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
24897
if (_ptCurrentCell.
X
== -1)
24916
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24921
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24928
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
24940
if (_ptCurrentCell.
X
== -1)
24956
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24961
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24974
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24977
_ptAnchorCell.
X
,
24985
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
24989
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24994
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25006
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
25007
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
25010
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25016
if (_ptCurrentCell.
X
== -1)
25030
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
25035
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25048
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
25051
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25059
if (_ptCurrentCell.
X
== -1)
25078
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25083
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25114
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
25122
_ptAnchorCell.
X
,
25132
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
25136
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
25141
if (_ptCurrentCell.
X
== -1)
25160
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25165
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25178
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
25181
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
25191
if (_ptCurrentCell.
X
== -1)
25210
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, forCurrentCellChange: true))
25215
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25220
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25225
if (_ptCurrentCell.
X
== -1)
25244
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25249
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25254
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
25271
if (_ptCurrentCell.
X
!= -1 && !IsCurrentCellInEditMode && ColumnEditable(_ptCurrentCell.
X
))
25280
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
25311
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
25353
_ptCurrentCell.
X
,
25366
dataGridViewCurrentCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
];
25391
dataGridViewCurrentCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
];
25473
if (_ptCurrentCell.
X
!= -1 && IsCurrentCellInEditMode)
26012
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26014
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26030
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26032
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26044
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26046
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26211
if (_ptCurrentCell.
X
>= 0 && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex))
26272
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26274
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26301
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26303
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26786
if (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex)
26806
int oldCurrentCellX = _ptCurrentCell.
X
;
26852
Debug.Assert(oldCurrentCellX == _ptCurrentCell.
X
);
26947
OnCellEnter(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y);
26962
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
26969
&& _ptCurrentCell.
X
!= -1
26987
if (_ptCurrentCell.
X
!= -1)
26989
AccessibilityNotifyCurrentCellChanged(new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y));
27016
int oldCurrentCellX = _ptCurrentCell.
X
;
27058
Debug.Assert(oldCurrentCellX == _ptCurrentCell.
X
);
27083
if (_ptCurrentCell.
X
!= -1)
28223
_ptCurrentCellCache.X = _ptCurrentCell.
X
;
28291
if (_ptCurrentCellCache.
X
!= -1)
28293
if (!IsInnerCellOutOfBounds(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y))
28296
_ptCurrentCellCache.
X
,
28499
if (_ptCurrentCell.
X
!= -1)
28501
dataGridViewColumn = Columns.GetNextColumn(Columns[_ptCurrentCell.
X
],
28521
if (_ptCurrentCell.
X
== -1)
28549
if (_ptCurrentCell.
X
== -1)
28572
if (_ptCurrentCell.
X
== -1)
28595
if (_ptCurrentCell.
X
== -1)
28626
if (_ptCurrentCell.
X
== -1)
28660
if (_ptCurrentCell.
X
!= -1)
28662
dataGridViewColumn = Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
],
28690
if (_ptCurrentCell.
X
== -1)
28718
if (_ptCurrentCell.
X
== -1)
28741
if (_ptCurrentCell.
X
== -1)
28764
if (_ptCurrentCell.
X
== -1)
28795
if (_ptCurrentCell.
X
== -1)
29158
HitTestInfo htiToUse = hti ?? HitTest(ptMouse.
X
, ptMouse.Y);
29164
if (_ptMouseEnteredCell.
X
!= htiToUse._col || _ptMouseEnteredCell.Y != htiToUse._row)
29167
if (_ptMouseEnteredCell.
X
>= -1
29168
&& _ptMouseEnteredCell.
X
< Columns.Count
29172
dgvce = new DataGridViewCellEventArgs(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y);
29192
else if (_ptMouseEnteredCell.
X
!= -2)
29194
if (_ptMouseEnteredCell.
X
>= -1
29195
&& _ptMouseEnteredCell.
X
< Columns.Count
29199
DataGridViewCellEventArgs dgvce = new(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y);
29868
HitTestInfo hti = HitTest(ptMouse.
X
, ptMouse.Y);
29869
int mouseX = ptMouse.
X
, mouseY = ptMouse.Y;
29891
? HitTest(ptMouse.
X
- xOffset - (xOffset / Math.Abs(xOffset)), ptMouse.Y - yOffset - normOffset)
29975
HitTestInfo hti = HitTest(client.
X
, client.Y);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (9)
446
ColumnIndex == DataGridView!.MouseDownCellAddress.
X
&& rowIndex == DataGridView.MouseDownCellAddress.Y;
540
ColumnIndex == DataGridView.MouseDownCellAddress.
X
&&
563
if (e.ColumnIndex == DataGridView.MouseDownCellAddress.
X
&&
660
bool cellCurrent = (ptCurrentCell.
X
== ColumnIndex && ptCurrentCell.Y == rowIndex);
726
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex && s_mouseInContentBounds)
782
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex && s_mouseInContentBounds)
819
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex &&
892
(DataGridView.CurrentCellAddress.Y == rowIndex && DataGridView.CurrentCellAddress.
X
== ColumnIndex))
927
(DataGridView.CurrentCellAddress.Y == rowIndex && DataGridView.CurrentCellAddress.
X
== ColumnIndex))
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (5)
406
return ptCurrentCell.
X
!= -1 &&
407
ptCurrentCell.
X
== ColumnIndex &&
1488
if (ColumnIndex == ptCurrentCell.
X
&& rowIndex == ptCurrentCell.Y)
2709
if (ptCurrentCell.
X
!= -1 &&
2710
ptCurrentCell.
X
== ColumnIndex &&
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (11)
433
return ptCurrentCell.
X
== ColumnIndex &&
520
if (ptCurrentCell.
X
== ColumnIndex &&
767
return ColumnIndex == DataGridView.MouseDownCellAddress.
X
&& rowIndex == DataGridView.MouseDownCellAddress.Y;
789
if (ptCurrentCell.
X
== ColumnIndex &&
893
ColumnIndex == DataGridView.MouseDownCellAddress.
X
&&
916
if (e.ColumnIndex == DataGridView.MouseDownCellAddress.
X
&&
1081
if (ptCurrentCell.
X
== ColumnIndex &&
1147
ptCurrentCell.
X
== ColumnIndex &&
1168
&& DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex
1302
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex &&
1444
&& DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (49)
809
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex)
1017
sortGlyphLocation.
X
,
1019
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1022
sortGlyphLocation.
X
+ 1,
1024
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1027
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1029
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1032
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1034
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1037
sortGlyphLocation.
X
,
1039
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1046
sortGlyphLocation.
X
,
1048
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1051
sortGlyphLocation.
X
+ 1,
1053
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1056
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1058
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1061
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1063
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1066
sortGlyphLocation.
X
,
1068
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1077
sortGlyphLocation.
X
+ line,
1079
sortGlyphLocation.
X
+ s_sortGlyphWidth - line - 1,
1084
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1086
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1101
sortGlyphLocation.
X
,
1103
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1106
sortGlyphLocation.
X
+ 1,
1108
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1111
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1113
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1116
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1118
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1121
sortGlyphLocation.
X
,
1123
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1130
sortGlyphLocation.
X
,
1132
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1135
sortGlyphLocation.
X
+ 1,
1137
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1140
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1142
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1145
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1147
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1150
sortGlyphLocation.
X
,
1152
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1161
sortGlyphLocation.
X
+ line,
1163
sortGlyphLocation.
X
+ s_sortGlyphWidth - line - 1,
1168
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1170
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (11)
1667
if (ptCurrentCell.
X
== e.ColumnIndex && ptCurrentCell.Y == e.RowIndex)
1891
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex;
1898
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex &&
1916
bool cellCurrent = ptCurrentCell.
X
== ColumnIndex && ptCurrentCell.Y == rowIndex;
2162
new(middle.
X
- s_offset2X, middle.Y - 1),
2163
new(middle.
X
+ s_offset2X + 1, middle.Y - 1),
2164
new(middle.
X
, middle.Y + s_offset2Y)
2181
Point pt1 = new(middle.
X
- (s_nonXPTriangleWidth - 1) / 2, middle.Y - s_nonXPTriangleHeight);
2182
Point pt2 = new(middle.
X
+ (s_nonXPTriangleWidth - 1) / 2, middle.Y - s_nonXPTriangleHeight);
2186
g.DrawLine(SystemPens.ControlText, pt1.
X
, pt1.Y, pt2.
X
, pt2.Y);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (3)
433
&& ColumnIndex == DataGridView.MouseDownCellAddress.
X
467
if (ColumnIndex == DataGridView.MouseDownCellAddress.
X
&&
492
Debug.Assert(ColumnIndex == DataGridView.MouseDownCellAddress.
X
);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
891
&& ptCurrentCell.
X
== ColumnIndex
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
908
bool cellCurrent = ptCurrentCell.
X
== ColumnIndex && ptCurrentCell.Y == rowIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (1)
2139
DataGridView.OnRowCollectionChanged_PostNotification(recreateNewRow, newCurrentCell.
X
== -1, cca, dataGridViewRow, rowIndex);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
691
DataGridView.MouseEnteredCellAddress.
X
== -1)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
576
if (ptCurrentCell.
X
== e.ColumnIndex && ptCurrentCell.Y == e.RowIndex && e.Button == MouseButtons.Left)
678
bool cellCurrent = ptCurrentCell.
X
== ColumnIndex && ptCurrentCell.Y == rowIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (1)
253
else if (DataGridView.MouseEnteredCellAddress.Y == rowIndex && DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex)
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
510
public void Draw(Graphics g, Point pt, int index) => Draw(g, pt.
X
, pt.Y, index);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
302
if ((r.left <= p.
X
&& p.
X
< r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND)
System\Windows\Forms\Controls\Labels\LinkLabel.LinkLabelAccessibleObject.cs (1)
65
Link? hit = owner.PointInLink(p.
X
, p.Y);
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
1504
return IndexFromPoint(p.
X
, p.Y);
System\Windows\Forms\Controls\ListView\ListView.cs (6)
3222
return FindNearestItem(dir, point.
X
, point.Y);
3713
public ListViewHitTestInfo HitTest(Point point) => HitTest(point.
X
, point.Y);
4388
item = GetItemAt(pos.
X
, pos.Y);
6004
AccessibleObject? accessibilityObject = AccessibilityObject.HitTest(screenPoint.
X
, screenPoint.Y);
6730
OnMouseClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
6735
OnMouseUp(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (1)
293
ListViewHitTestInfo hitTestInfo = owningListView.HitTest(point.
X
, point.Y);
System\Windows\Forms\Controls\ListView\ListViewItem.cs (1)
646
_listView.SetItemPosition(Index, _position.
X
, _position.Y);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarButtonAccessibleObject.cs (1)
83
SendMouseInput(previousPosition.
X
, previousPosition.Y, MOUSE_EVENT_FLAGS.MOUSEEVENTF_MOVE | MOUSE_EVENT_FLAGS.MOUSEEVENTF_ABSOLUTE);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1332
public HitTestInfo HitTest(Point point) => HitTest(point.
X
, point.Y);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
2396
OnMouseMove(new MouseEventArgs(e.Button, e.Clicks, newPoint.
X
, newPoint.Y, e.Delta));
2412
OnMouseDown(new MouseEventArgs(e.Button, e.Clicks, newPoint.
X
, newPoint.Y, e.Delta));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
237
LinkLabel.Link link = Label.Links.Add(links[i].
X
, links[i].Y, _verbs[i]);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
309
int x = _detailsTextBox.Location.
X
;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (37)
457
return new Point(point.
X
+ (rect.Width / 2), point.Y + (rect.Height / 2));
619
return new Rectangle(pt.
X
, pt.Y, rect.Width, rect.Height);
678
g.TranslateTransform(newOrigin.
X
, newOrigin.Y);
679
r.Offset(-newOrigin.
X
, -newOrigin.Y);
1073
return _location.
X
+ GetEntryLabelIndent(gridEntry) + size.Width;
1084
return length > _location.
X
+ LabelWidth;
1111
clipRect.Offset(-newOrigin.
X
, -newOrigin.Y);
1166
clipRect.Offset(-newOrigin.
X
, -newOrigin.Y);
1425
Math.Max(rectScreen.X, location.
X
+ rect.X + rect.Width - size.Width));
1454
_dropDownHolder.SetBounds(location.
X
, location.Y, size.Width, size.Height);
1653
if (x < 0 || x > size.Width + _location.
X
)
1659
if (x > LabelWidth + _location.
X
)
1884
rect.X = _location.
X
;
1901
rect.X = _location.
X
+ LabelWidth;
2100
int startPS = _location.
X
;
2606
if (Math.Abs(screenPoint.
X
- _rowSelectPos.
X
) < SystemInformation.DoubleClickSize.Width &&
3040
if (point == InvalidPosition || (point.
X
!= RowLabel && point.
X
!= RowValue))
3048
onLabel = point.
X
== RowLabel;
3062
if ((rowMoveCurrent != TipRow || point.
X
!= TipColumn) && !_flags.HasFlag(Flags.IsSplitterMove))
3070
Rectangle itemRect = GetRectangle(point.Y, point.
X
);
3075
TipColumn = point.
X
;
3085
TipColumn = point.
X
;
3323
int lineEnd = location.
X
+ size.Width;
3324
int lineStart = location.
X
;
3806
int overhang = toolTip.Location.
X
+ toolTip.Size.Width - SystemInformation.VirtualScreen.Width;
4439
_labelWidth = _location.
X
+ (int)(size.Width / _labelRatio);
4457
_labelRatio = GetOurSize().Width / (double)(oldWidth - _location.
X
);
4838
if (_labelWidth > _location.
X
+ size.Width)
4840
_labelWidth = _location.
X
+ (int)(size.Width / _labelRatio);
4844
_labelRatio = GetOurSize().Width / (double)(_labelWidth - _location.
X
);
5257
mouseLoc = FindPosition(mouseLoc.
X
, mouseLoc.Y);
5272
Rectangle itemRect = GetRectangle(mouseLoc.Y, mouseLoc.
X
);
5276
if (mouseLoc.
X
== RowLabel)
5278
tipPt = curEntry.GetLabelToolTipLocation(mouseLoc.
X
- itemRect.X, mouseLoc.Y - itemRect.Y);
5280
else if (mouseLoc.
X
== RowValue)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
454
int delta = dragPoint.
X
- _dragStart.
X
;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.PropertyGridViewAccessibleObject.cs (1)
435
Point position = owner.FindPosition(point.
X
, point.Y);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2218
Point wpt = new(pt.
X
, pt.Y);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (4)
131
MousePosition.
X
,
137
MousePosition.
X
,
236
MousePosition.
X
,
242
MousePosition.
X
,
System\Windows\Forms\Controls\Splitter\Splitter.cs (2)
775
delta = x - _anchor.
X
;
959
int size = GetSplitSize(splitTarget, x - Left + _anchor.
X
, y - Top + _anchor.Y);
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
393
r.X -= p.
X
;
594
if (value.
X
< 0 || value.Y < 0)
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (2)
126
clientLocation.X = Math.Max(clientLocation.
X
, clientRectangle.left);
127
clientLocation.X = Math.Min(clientLocation.
X
, clientRectangle.right);
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
590
int deltaRightEdge = Math.Abs(rootHwndClientArea.right - gripLocation.
X
);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (8)
2164
int oppositeSide = otherItemMidLocation.
X
- midPointOfCurrent.
X
;
2606
if (location.
X
!= x || location.Y != y)
2626
if (location.
X
!= x || location.Y != y)
3331
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
3387
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
3431
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
4513
cursorLocation.X += currentCursor.HotSpot.
X
+ 1;
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (3)
150
new(middle.
X
- s_offsetPixels, middle.Y - 1),
151
new(middle.
X
+ s_offsetPixels + 1, middle.Y - 1),
152
new(middle.
X
, middle.Y + s_offsetPixels)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
1040
dropDownBounds.Location = new Point(start.
X
+ offset.
X
, start.Y + offset.Y);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (2)
336
dropDownBounds.Location = new Point(itemScreenLocation.
X
+ offset.
X
, itemScreenLocation.Y + offset.Y);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (4)
364
_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.
X
, nextPoint.Y, maxCheckSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter);
369
_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.
X
, nextPoint.Y, maxImageSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter);
380
_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.
X
, nextPoint.Y, checkAndImageMarginWidth, _maxItemSize.Height), ContentAlignment.MiddleCenter);
399
_checkRectangle = LayoutUtils.Align(LayoutUtils.UnionSizes(maxCheckSize, maxImageSize), new Rectangle(nextPoint.
X
, nextPoint.Y, checkAndImageMarginWidth - 1, _maxItemSize.Height), ContentAlignment.MiddleCenter);
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (2)
132
int deltaX = currentLocation.
X
- _startLocation.
X
;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
3456
toPoint.X += currentToolStripItemLocation.
X
;
3468
fromPoint.X += currentToolStripItemLocation.
X
;
3483
fromPoint.X -= currentToolStripItemLocation.
X
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (4)
809
if (clientLocation.
X
< 0 || clientLocation.Y < 0)
867
index = (clientLocation.
X
<= Padding.Left) ? 0 : index;
894
Point endLocation = (Orientation == Orientation.Horizontal) ? new Point(clientLocation.
X
, row.Bounds.Y) : new Point(row.Bounds.X, clientLocation.Y);
964
cursorLoc.X = Cursor.Position.
X
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (6)
149
int deltaX = clientEndLocation.
X
- clientStartLocation.
X
;
421
if (Row.Cells[index].Bounds.X >= locationToDrag.
X
)
449
requiredSpace += locationToDrag.
X
;
496
lastCellMargin.Left = Math.Max(0, locationToDrag.
X
- nextCell.Bounds.Right);
543
cellMargin.Left = Math.Max(0, locationToDrag.
X
- Row.Margin.Left);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (27)
195
middle.
X
- Offset2X,
197
middle.
X
+ Offset2X,
200
middle.
X
- Offset2X + 1 + rightToLeftShift,
202
middle.
X
+ Offset2X + 1 + rightToLeftShift,
862
Rectangle bottomLeftParentVerticalPixels = new(bottomLeft.
X
, bottomLeft.Y - 1, 1, 2);
865
Rectangle bottomRightHorizontalPixels = new(bottomRight.
X
- 1, bottomRight.Y, 2, 1);
866
Rectangle bottomRightVerticalPixels = new(bottomRight.
X
, bottomRight.Y - 1, 1, 2);
873
topRightHorizontalPixels = new Rectangle(topRight.
X
- 1, topRight.Y, 1, 1);
874
topRightVerticalPixels = new Rectangle(topRight.
X
, topRight.Y, 1, 2);
878
topRightHorizontalPixels = new Rectangle(topRight.
X
- 2, topRight.Y, 2, 1);
879
topRightVerticalPixels = new Rectangle(topRight.
X
, topRight.Y, 1, 3);
1149
b.TranslateTransform(parent.Width - control.Location.
X
, parent.Height - control.Location.Y);
1307
g.FillRectangle(brush, top1.
X
, top1.Y, 1, 1);
1308
g.FillRectangle(brush, top2.
X
, top2.Y, 1, 1);
1396
Rectangle otherBottom = new(bottomLeft.
X
, bottomLeft.Y - 2, 1, 1);
1657
new(middle.
X
- Offset2X, middle.Y + 1),
1658
new(middle.
X
+ Offset2X + 1, middle.Y + 1),
1659
new(middle.
X
, middle.Y - Offset2Y)
1663
new(middle.
X
+ Offset2X, middle.Y - Offset2Y - 1),
1664
new(middle.
X
+ Offset2X, middle.Y + Offset2Y + 1),
1665
new(middle.
X
- 1, middle.Y)
1669
new(middle.
X
- Offset2X, middle.Y - Offset2Y - 1),
1670
new(middle.
X
- Offset2X, middle.Y + Offset2Y + 1),
1671
new(middle.
X
+ 1, middle.Y)
1675
new(middle.
X
- Offset2X, middle.Y - 1),
1676
new(middle.
X
+ Offset2X + 1, middle.Y - 1),
1677
new(middle.
X
, middle.Y + Offset2Y)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (12)
671
arrow[0] = new(middle.
X
- Offset2X, middle.Y + 1);
672
arrow[1] = new(middle.
X
+ Offset2X + 1, middle.Y + 1);
673
arrow[2] = new(middle.
X
, middle.Y - Offset2Y);
677
arrow[0] = new(middle.
X
+ Offset2X, middle.Y - s_offset4Y);
678
arrow[1] = new(middle.
X
+ Offset2X, middle.Y + s_offset4Y);
679
arrow[2] = new(middle.
X
- horizontalOffset, middle.Y);
683
arrow[0] = new(middle.
X
- Offset2X, middle.Y - s_offset4Y);
684
arrow[1] = new(middle.
X
- Offset2X, middle.Y + s_offset4Y);
685
arrow[2] = new(middle.
X
+ horizontalOffset, middle.Y);
689
arrow[0] = new(middle.
X
- Offset2X, middle.Y - 1);
690
arrow[1] = new(middle.
X
+ Offset2X + 1, middle.Y - 1);
691
arrow[2] = new(middle.
X
, middle.Y + Offset2Y);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (2)
213
if ((orig.Left + widthUnit) >= check.
X
)
217
else if ((orig.Right - widthUnit) <= check.
X
)
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemDarkModeRenderer.cs (12)
480
new Point(middle.
X
- 2, middle.Y + 1),
481
new Point(middle.
X
+ 3, middle.Y + 1),
482
new Point(middle.
X
, middle.Y - 2)
486
new Point(middle.
X
+ 2, middle.Y - 4),
487
new Point(middle.
X
+ 2, middle.Y + 4),
488
new Point(middle.
X
- 2, middle.Y)
492
new Point(middle.
X
- 2, middle.Y - 4),
493
new Point(middle.
X
- 2, middle.Y + 4),
494
new Point(middle.
X
+ 2, middle.Y)
498
new Point(middle.
X
- 2, middle.Y - 1),
499
new Point(middle.
X
+ 3, middle.Y - 1),
500
new Point(middle.
X
, middle.Y + 2)
System\Windows\Forms\Controls\TreeView\TreeView.cs (8)
1633
public TreeViewHitTestInfo HitTest(Point pt) => HitTest(pt.
X
, pt.Y);
1674
public TreeNode? GetNodeAt(Point pt) => GetNodeAt(pt.
X
, pt.Y);
3048
OnNodeMouseClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), button, 1, pos.
X
, pos.Y));
3049
OnClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3050
OnMouseClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3078
OnMouseUp(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3323
OnNodeMouseClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), _downButton, 1, point.
X
, point.Y));
3335
OnNodeMouseDoubleClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), _downButton, 2, point.
X
, point.Y));
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
904
return new MouseEventArgs(e.Button, e.Clicks, point.
X
, point.Y, e.Delta);
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
461
htmlDoc2.Value->elementFromPoint(point.
X
, point.Y, &iHTMLElement).ThrowOnFailure();
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (2)
304
htmlWindow.Value->moveTo(point.
X
, point.Y).ThrowOnFailure();
410
htmlWindow.Value->scrollTo(point.
X
, point.Y).ThrowOnFailure();
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1352
if (location.
X
== -1)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.WebBrowserSite.cs (1)
44
if (pt->
X
== 0 && pt->Y == 0)
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
791
Bounds = new Rectangle(location.
X
, location.Y, extent.Width, extent.Height);
1130
sz.Width = phm.
X
;
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
178
PInvoke.SetViewportOrgEx(hdc, originalOrigin.
X
+ _windowBounds.Width - 1, originalOrigin.Y, lppt: null);
System\Windows\Forms\Form.cs (5)
927
SetDesktopLocation(value.
X
, value.Y);
1367
Location.
X
,
3936
if (p.
X
< screenRect.X)
3940
else if (p.
X
+ s.Width > screenRect.X + screenRect.Width)
7001
if (point.
X
>= (clientSize.Width - SizeGripSize) &&
System\Windows\Forms\Input\Cursor.cs (1)
187
set => PInvoke.SetCursorPos(value.
X
, value.Y);
System\Windows\Forms\Input\HandledMouseEventArgs.cs (1)
14
: this(button, clicks, location.
X
, location.Y, delta, false)
System\Windows\Forms\Input\MouseEventArgs.cs (1)
31
X = location.
X
;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
691
return new Rectangle(topLeftPoint.
X
, topLeftPoint.Y, clientRectangle.right, clientRectangle.bottom);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (7)
453
if ((r.left <= p.
X
&& p.
X
< r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND)
1356
_splitterRect.X = Location.
X
+ SplitterDistanceInternal;
1388
r.X = Panel1.Location.
X
+ splitSize;
1491
delta = x - _anchor.
X
;
1571
_splitterRect.X = ((RightToLeft == RightToLeft.Yes) ? Width - _splitterDistance - SplitterWidthInternal : Location.
X
+ _splitterDistance);
1578
_splitterRect.X = Location.
X
;
System\Windows\Forms\Layout\FlowLayout.ContainerProxy.cs (3)
71
pt.Offset(0, ptScroll.
X
);
75
pt.Offset(ptScroll.
X
, 0);
161
pt.Offset(ptScroll.
X
, 0);
System\Windows\Forms\Layout\FlowLayout.cs (2)
243
if (location.
X
> rowBounds.Right)
252
rowSize.Width = location.
X
- rowBounds.X;
System\Windows\Forms\Layout\LayoutUtils.cs (1)
436
(point.Y, point.X) = (point.
X
, point.Y);
System\Windows\Forms\NotifyIcon.cs (1)
617
_contextMenuStrip.ShowInTaskbar(pt.
X
, pt.Y);
System\Windows\Forms\Printing\PrintPreviewControl.cs (11)
628
offset.X -= Position.
X
;
631
int borderPixelsX = PhysicalToPixels(Border, _screenDPI.
X
);
664
int x = offset.
X
+ borderPixelsX * (column + 1) + lastImageSize.
X
;
752
new(PixelsToPhysical(pixels.Width, dpi.
X
), PixelsToPhysical(pixels.Height, dpi.Y));
758
new(PhysicalToPixels(physical.Width, dpi.
X
), PhysicalToPixels(physical.Height, dpi.Y));
764
_hScrollBar.Value = Math.Clamp(value.
X
, _hScrollBar.Minimum, _hScrollBar.Maximum);
919
pos = vertical ? locPos.Y : locPos.
X
;
952
pos = vertical ? locPos.Y : locPos.
X
;
1037
pos = locPos.
X
;
1055
pos = locPos.
X
;
System\Windows\Forms\Rendering\ControlPaint.cs (3)
432
transform.Translate(scrollOffset.
X
, scrollOffset.Y);
1834
PInvoke.MoveToEx(desktopDC, start.
X
, start.Y, lppt: null);
1835
PInvoke.LineTo(desktopDC, end.
X
, end.Y);
System\Windows\Forms\Rendering\DCMapping.cs (3)
47
viewportOrg.
X
+ bounds.Left,
49
viewportOrg.
X
+ bounds.Right,
60
viewportOrg.
X
+ bounds.Left,
System\Windows\Forms\Scrolling\ScrollableControl.cs (4)
126
SetDisplayRectLocation(-value.
X
, -value.Y);
833
SetDisplayRectLocation(scrollLocation.
X
, scrollLocation.Y);
892
xCalc += activeControl.AutoScrollOffset.
X
;
1113
if (pt.
X
!= 0 || pt.Y != 0)
System\Windows\Forms\ToolTip\ToolTip.cs (13)
1320
if (cursorLocation.
X
< rect.left || cursorLocation.
X
> rect.right ||
1336
SetTrackPosition(p.
X
, p.Y);
1410
int pointX = r.left + point.
X
;
1430
int pointX = r.left + point.
X
;
1498
pointX = optimalPoint.
X
;
1933
if (moveToLocation.
X
+ tipSize.Width > screen.WorkingArea.Right)
1938
if (moveToLocation.
X
< screen.WorkingArea.Left)
1952
moveToLocation.
X
,
2012
if (cursorLocation.
X
>= r.left && cursorLocation.
X
<= r.right &&
2185
wp->x = cursorPos.
X
;
2205
wp->x = tipInfo.Position.
X
;
System.Windows.Forms.Design (345)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (3)
252
new(middle.
X
- s_offset2X, middle.Y - 1),
253
new(middle.
X
+ s_offset2X + 1, middle.Y - 1),
254
new(middle.
X
, middle.Y + s_offset2Y)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (4)
174
_button.Location = new Point(EditRegionLocation.
X
+ EditRegionSize.Width - buttonHeight - EditorLineButtonPadding, EditRegionLocation.Y + EditorLineButtonPadding + 1);
297
g.DrawImage(_swatch, new Point(EditRegionRelativeLocation.
X
+ 2, EditorLineSwatchPadding + 5));
348
Math.Max(rectScreen.X, editorLocation.
X
+ editorBounds.Right - dropDownSize.Width)); // max = left screen edge clip
372
Math.Max(rectScreen.X, editorLocation.
X
- editorBounds.Width)); // max = left screen edge clip
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
114
EditControl!.Location = new Point(_editRegionLocation.
X
+ GetTextBoxLeftPadding(textBoxPreferredHeight) + 1 + specialPadding, _editRegionLocation.Y + TextBoxLineInnerPadding + 1);
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
168
int maxDelta = location.
X
- workingArea.Left;
System\Drawing\Design\ColorEditor.ColorPalette.ColorPaletteAccessibleObject.ColorCellAccessibleObject.cs (2)
33
FillRectWithCellBounds(cellPt.
X
, cellPt.Y, ref rect);
43
return new Rectangle(pt.
X
, pt.Y, rect.Width, rect.Height);
System\Drawing\Design\ColorEditor.ColorPalette.ColorPaletteAccessibleObject.cs (1)
45
int cell = GetCellFromLocationMouse(point.
X
, point.Y);
System\Drawing\Design\ColorEditor.ColorPalette.cs (15)
180
private static int Get1DFrom2D(Point pt) => Get1DFrom2D(pt.
X
, pt.Y);
219
FillRectWithCellBounds(_focus.
X
, _focus.Y, ref r);
225
1 + Get1DFrom2D(_focus.
X
, _focus.Y));
276
SelectedColor = GetColorFromCell(_focus.
X
, _focus.Y);
281
SelectedColor = GetColorFromCell(_focus.
X
, _focus.Y);
285
SetFocus(_focus with { X = _focus.
X
- 1 });
288
SetFocus(_focus with { X = _focus.
X
+ 1 });
312
if (cell2D.
X
!= -1 && cell2D.Y != -1 && cell2D != _focus)
326
if (cell2D.
X
!= -1 && cell2D.Y != -1 && cell2D != _focus)
340
if (cell2D.
X
!= -1 && cell2D.Y != -1)
343
SelectedColor = GetColorFromCell(_focus.
X
, _focus.Y);
392
if (_focus.
X
== x && _focus.Y == y && Focused)
425
int cell = Get1DFrom2D(_focus.
X
, _focus.Y);
439
if (newFocus.
X
< 0)
449
if (newFocus.
X
>= CellsAcross)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (3)
133
region.Translate(scrollPosition.
X
, scrollPosition.Y);
150
rectangle.Offset(scrollPosition.
X
, scrollPosition.Y);
320
pt.Offset(pt1.
X
, pt1.Y);
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (3)
99
if (ProcessMouseMessage(mhs->hwnd, (MessageId)(nuint)wparam, mhs->pt.
X
, mhs->pt.Y))
180
Message m = Message.Create(hwnd, msg, 0u, PARAM.FromLowHigh(pt.Y, pt.
X
));
196
if (!adornerWindow.WndProcProxy(ref m, pt.
X
, pt.Y))
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (3)
179
Size delta = new(Math.Abs(mouseLoc.
X
- InitialDragPoint.
X
), Math.Abs(mouseLoc.Y - InitialDragPoint.Y));
184
screenLoc.Offset(mouseLoc.
X
, mouseLoc.Y);
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (1)
161
_bounds = (new Rectangle(topRight.
X
, topRight.Y, GlyphImageOpened.Width, GlyphImageOpened.Height));
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (13)
215
controlRect.X += offset.
X
; // offset for non-client area
690
if (directionOffset.
X
!= 0)
695
int minRange = directionOffset.
X
< 0 ? 0 : currentBounds.X;
696
int maxRange = directionOffset.
X
< 0 ? currentBounds.Right : int.MaxValue;
697
offset.X = FindSmallestValidDistance(_verticalSnapLines, _verticalDistances, minRange, maxRange, directionOffset.
X
);
698
if (offset.
X
!= 0)
701
IdentifyAndStoreValidLines(_verticalSnapLines, _verticalDistances, currentBounds, offset.
X
);
702
if (directionOffset.
X
< 0)
732
_cachedDragRect.Offset(offset.
X
, offset.Y);
733
if (offset.
X
!= 0)
1100
_dragOffset = new Point(dragBounds.X - _dragOffset.
X
, dragBounds.Y - _dragOffset.Y);
1111
_targetVerticalSnapLines[i].AdjustOffset(_dragOffset.
X
);
1144
Rectangle tempDragRect = new(dragBounds.Left + snapPoint.
X
, dragBounds.Top + snapPoint.Y, dragBounds.Width, dragBounds.Height);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (22)
143
Point controlLocation = new(dragLoc.
X
- _parentLocation.
X
, dragLoc.Y - _parentLocation.Y);
146
int xDelta = controlLocation.
X
% _parentGridSize.Width;
271
Point pt = new(dropPoint.
X
, dropPoint.Y);
276
pt.Offset(-ptScroll.
X
, -ptScroll.Y);
493
Point dropPoint = new(initialDropPoint.
X
+ _dragComponents[i].positionOffset.
X
,
739
Point newPosition = new(mouseLoc.
X
- _initialMouseLoc.
X
+ _dragComponents[_primaryComponentIndex].originalControlLocation.
X
,
744
Rectangle newRect = new(newPosition.
X
, newPosition.Y,
776
newPosition.X += _lastSnapOffset.
X
;
788
newPosition = new Point(mouseLoc.
X
- _initialMouseLoc.
X
+ _originalDragImageLocation.
X
,
790
newPosition.X += _lastSnapOffset.
X
;
806
invalidDragRegion.Translate(mouseLoc.
X
- _initialMouseLoc.
X
+ _lastSnapOffset.
X
, mouseLoc.Y - _initialMouseLoc.Y + _lastSnapOffset.Y);
948
_dragComponents[i].positionOffset = new Point(dragControl.Location.
X
- primaryControl.Location.
X
,
1033
Rectangle controlRect = new(_dragComponents[i].draggedLocation.
X
- _dragImageRect.X,
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (18)
181
lines.Add(new SnapLine(SnapLineType.Right, loc.
X
- 1));
184
lines.Add(new SnapLine(SnapLineType.Vertical, loc.
X
+ _primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always));
189
lines.Add(new SnapLine(SnapLineType.Left, loc.
X
));
192
lines.Add(new SnapLine(SnapLineType.Vertical, loc.
X
- _primaryControl.Margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
275
_parentLocation.X -= control.Location.
X
;
482
Point mouseLocAbs = new(mouseLoc.
X
, mouseLoc.Y);
484
if (mouseLocAbs.
X
== _lastMouseAbs.
X
&& mouseLocAbs.Y == _lastMouseAbs.Y)
492
if (Math.Abs(_initialPoint.
X
- mouseLoc.
X
) > DesignerUtils.MinDragSize.Width / 2 || Math.Abs(_initialPoint.Y - mouseLoc.Y) > DesignerUtils.MinDragSize.Height / 2)
547
_lastMouseAbs = new Point(mouseLoc.
X
, mouseLoc.Y);
610
mouseLoc.X += _lastSnapOffset.
X
;
712
int xOffset = _initialPoint.
X
;
718
bounds.Width = Math.Max(minWidth, baseBounds.Width + (!fRTL ? (mouseLoc.
X
- xOffset) : (xOffset - mouseLoc.
X
)));
725
int xPos = _initialPoint.
X
;
731
int xOffset = !fRTL ? (xPos - mouseLoc.
X
) : (mouseLoc.
X
- xPos);
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (2)
250
int delta = isColumn ? mouseLoc.
X
- _lastMouseLoc.
X
: mouseLoc.Y - _lastMouseLoc.Y;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (9)
130
offset.X = _lastRectangle.Left - mouseLoc.
X
;
136
offset.X = _lastRectangle.Right - mouseLoc.
X
;
188
offset.X = _lastRectangle.Left - mouseLoc.
X
;
194
offset.X = _lastRectangle.Right - mouseLoc.
X
;
213
offset.X = _lastRectangle.Left - mouseLoc.
X
;
259
ToolboxSnapDragDropEventArgs se = CreateToolboxSnapArgs(e, new Point(e.X - screenOffset.
X
, e.Y - screenOffset.Y));
310
mouseLoc.
X
- DesignerUtils.s_boxImageSize / 2,
321
newRectangle.Offset(_lastOffset.
X
, _lastOffset.Y);
346
Rectangle statusRect = new(newRectangle.X - adornerServiceOrigin.
X
, newRectangle.Y - adornerServiceOrigin.Y, 0, 0);
System\Windows\Forms\Design\CommandSet.cs (43)
818
moveOffsetX = snappedOffset.
X
;
887
moveOffsetX = loc.
X
- primaryControl.Location.
X
;
1059
loc.X = primaryLocation.
X
+ primarySize.Width - size.Width;
1067
loc.X = primarySize.Width / 2 + primaryLocation.
X
- size.Width / 2;
1076
loc.X = primaryLocation.
X
;
1188
delta = loc.
X
% gridSize.Width;
1302
if (loc.
X
< left)
1303
left = loc.
X
;
1306
if (loc.
X
+ size.Width > right)
1307
right = loc.
X
+ size.Width;
2432
loc.X = (loc.
X
/ grid.Width) * grid.Width;
2702
? (lastSize.Width + lastLoc.
X
- curLoc.
X
- total) / (selectedObjects.Length - 1)
2799
curLoc.X = lastLoc.
X
+ lastSize.Width;
2806
if (curLoc.
X
< primaryLoc.
X
)
2807
curLoc.X = primaryLoc.
X
;
2812
if (curLoc.
X
> primaryLoc.
X
)
2813
curLoc.X = primaryLoc.
X
;
2829
curLoc.X = lastLoc.
X
+ lastSize.Width + nEqualDelta;
3251
if (min.
X
> loc.
X
)
3253
min.X = loc.
X
;
3261
if (max.
X
< loc.
X
+ size.Width)
3263
max.X = loc.
X
+ size.Width;
3278
Point offset = new(-min.
X
, -min.Y);
3292
parentOffset.X -= (max.
X
- min.
X
) / 2;
3374
groupEndX = parentOffset.
X
+ max.
X
- min.
X
;
3379
groupEndX = parentOffset.
X
+ gridSize.Width;
3404
offset.Offset(parentOffset.
X
, parentOffset.Y);
3417
newLoc.Offset(offset.
X
, offset.Y);
3474
return pLoc.
X
== qLoc.
X
? pLoc.Y - qLoc.Y : pLoc.
X
- qLoc.
X
;
3492
return pLoc.Y == qLoc.Y ? pLoc.
X
- qLoc.
X
: pLoc.Y - qLoc.Y;
System\Windows\Forms\Design\ComponentTray.cs (36)
604
SetTrayLocation(comp, new Point(tc.Location.
X
- _autoScrollPosBeforeDragging.
X
, tc.Location.Y - _autoScrollPosBeforeDragging.Y));
608
AutoScrollPosition = new Point(-_autoScrollPosBeforeDragging.
X
, -_autoScrollPosBeforeDragging.Y);
660
mcs.ShowContextMenu(MenuCommands.TraySelectionMenu, location.
X
, location.Y);
664
mcs.ShowContextMenu(MenuCommands.ComponentTrayMenu, location.
X
, location.Y);
994
return new Point(loc.
X
- autoScrollLoc.
X
, loc.Y - autoScrollLoc.Y);
1205
_mouseDragWorkspace.X = Math.Min(start.
X
, end.
X
);
1207
_mouseDragWorkspace.Width = Math.Abs(end.
X
- start.
X
);
1340
X = Math.Min(_mouseDragStart.
X
, e.X),
1342
Width = Math.Abs(e.X - _mouseDragStart.
X
),
1575
location = new Point(location.
X
+ autoScrollLoc.
X
, location.Y + autoScrollLoc.Y);
1619
if (location.
X
== -1 && location.Y == -1)
1825
_whiteSpace.X = _whiteSpace.
X
* 2 + 3;
1832
Point newLoc = new(display.X + _whiteSpace.
X
, display.Y + _whiteSpace.Y);
1844
newLoc = new Point(newLoc.
X
- autoScrollLoc.
X
, newLoc.Y - autoScrollLoc.Y);
1860
Point newLoc = new(bounds.X + bounds.Width + _whiteSpace.
X
, bounds.Y);
1863
if (newLoc.
X
+ c.Size.Width > Size.Width)
1865
newLoc.X = _whiteSpace.
X
;
1879
newLoc = new Point(newLoc.
X
- autoScrollLoc.
X
, newLoc.Y - autoScrollLoc.Y);
2196
(Math.Abs(_mouseDragLast.
X
- newPt.
X
) < minDrag.Width &&
2216
if (_tray._selectionUISvc is not null && _tray._selectionUISvc.BeginDrag(SelectionRules.Visible | SelectionRules.Moveable, _mouseDragLast.
X
, _mouseDragLast.Y))
2257
mcs.ShowContextMenu(MenuCommands.TraySelectionMenu, location.
X
, location.Y);
2539
if (location.
X
== -1 && location.Y == -1)
2553
pt.Offset(pt1.
X
, pt1.Y);
2556
pt.Offset(Location.
X
, Location.Y);
2778
if (tcLoc1.
X
== tcLoc2.
X
&& tcLoc1.Y == tcLoc2.Y)
2796
return ((tcLoc1.
X
<= tcLoc2.
X
) ? -1 : 1);
System\Windows\Forms\Design\ControlCommandSet.cs (7)
480
lines.Add(new SnapLine(SnapLineType.Right, pt.
X
+ primaryControl.Width - 1));
481
lines.Add(new SnapLine(SnapLineType.Vertical, pt.
X
+ primaryControl.Width + primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always));
488
lines.Add(new SnapLine(SnapLineType.Left, pt.
X
));
489
lines.Add(new SnapLine(SnapLineType.Vertical, pt.
X
- primaryControl.Margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
644
primaryControlsize += new Size(snappedOffset.
X
, snappedOffset.Y);
655
moveOffsetX = snappedOffset.
X
;
717
Rectangle dragRect = new(primaryControl.Location.
X
, primaryControl.Location.Y,
System\Windows\Forms\Design\ControlDesigner.cs (18)
89
loc.Offset(-pt.
X
, -pt.Y);
99
value.Offset(pt.
X
, pt.Y);
301
return new Point(Math.Abs(nativeOffset.
X
- offset.
X
), nativeOffset.Y - offset.Y);
1400
(Math.Abs(_mouseDragLast.
X
- x) < minDrag.Width &&
1893
if (button == MouseButtons.Left && IsDoubleClick(location.
X
, location.Y))
1934
mouseHandler.OnMouseDown(Component, button, location.
X
, location.Y);
1938
OnMouseDragBegin(location.
X
, location.Y);
1947
_lastMoveScreenX = location.
X
;
1969
if (_lastMoveScreenX != location.
X
|| _lastMoveScreenY != location.Y)
1983
mouseHandler.OnMouseMove(Component, location.
X
, location.Y);
1987
OnMouseDragMove(location.
X
, location.Y);
1991
_lastMoveScreenX = location.
X
;
2085
graphics.TranslateTransform(-point.
X
, -point.Y);
2211
bool handled = GetService<ToolStripKeyboardHandlingService>()?.OnContextMenu(location.
X
, location.Y) ?? false;
2215
if (location.
X
== -1 && location.Y == -1)
2221
OnContextMenu(location.
X
, location.Y);
2400
return PARAM.ToInt(pt.
X
, pt.Y);
System\Windows\Forms\Design\DesignerUtils.cs (4)
586
newBounds.X += e.Offset.
X
; // snap to left-
590
newBounds.X = originalBounds.X - originalBounds.Width + e.Offset.
X
;
599
newBounds.X = originalBounds.X - originalBounds.Width - e.Offset.
X
;
604
newBounds.X -= e.Offset.
X
;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (40)
230
marginBounds.Offset(offset.
X
, offset.Y);
231
bounds.Offset(offset.
X
, offset.Y);
450
point1.Offset(-offset.
X
, -offset.Y);
451
point2.Offset(-offset.
X
, -offset.Y);
459
_oldPoint1.
X
,
461
_oldPoint2.
X
- _oldPoint1.
X
+ 1,
488
graphics.DrawLine(pen, point1.
X
- IBarHalfSize, point1.Y, point1.
X
+ IBarHalfSize, point1.Y); // top hat
489
graphics.DrawLine(pen, point2.
X
- IBarHalfSize, point2.Y, point2.
X
+ IBarHalfSize, point2.Y); // bottom hat
500
point1.
X
- (IBarHatWidth - 1 - i * 2) / 2,
502
point1.
X
+ (IBarHatWidth - 1 - i * 2) / 2,
507
point2.
X
- (IBarHatWidth - 1 - i * 2) / 2,
509
point2.
X
+ (IBarHatWidth - 1 - i * 2) / 2,
514
graphics.DrawLine(pen, point1.
X
, point1.Y, point1.
X
, point1.Y + IBarHatHeight - 1); // top hat
515
graphics.DrawLine(pen, point2.
X
, point2.Y, point2.
X
, point2.Y - IBarHatHeight + 1); // bottom hat
518
graphics.DrawLine(pen, point1.
X
, point1.Y + IBarLineOffset, point2.
X
, point2.Y - IBarLineOffset);
523
if (Math.Abs(point1.
X
- point2.
X
) <= MinIBar)
527
graphics.DrawLine(pen, point1.
X
, point1.Y - IBarHalfSize, point1.
X
, point1.Y + IBarHalfSize); // top hat
528
graphics.DrawLine(pen, point2.
X
, point2.Y - IBarHalfSize, point2.
X
, point2.Y + IBarHalfSize); // bottom hat
539
point1.
X
+ i,
541
point1.
X
+ i,
546
point2.
X
- i,
548
point2.
X
- i,
553
graphics.DrawLine(pen, point1.
X
, point1.Y, point1.
X
+ IBarHatHeight - 1, point1.Y); // left hat
554
graphics.DrawLine(pen, point2.
X
, point2.Y, point2.
X
- IBarHatHeight + 1, point2.Y); // right hat
557
graphics.DrawLine(pen, point1.
X
+ IBarLineOffset, point1.Y, point2.
X
- IBarLineOffset, point2.Y);
848
int offset = HorizontalFlow ? controlOffset.Y : controlOffset.
X
;
856
match = (HorizontalFlow && mouseLocation.Y <= offset) || (!HorizontalFlow && mouseLocation.
X
>= offset);
861
match = (HorizontalFlow ? mouseLocation.Y : mouseLocation.
X
) <= offset;
System\Windows\Forms\Design\OleDragDropHandler.cs (9)
372
newRect.X = oldOffset.
X
;
377
newRect.Offset(oldOffset.
X
, oldOffset.Y);
393
newRect.X = newOffset.
X
;
398
newRect.Offset(newOffset.
X
, newOffset.Y);
605
if ((Dragging && de.X == _dragBase.
X
&& de.Y == _dragBase.Y) ||
769
bounds.X = dropPt.
X
+ pt.
X
;
845
Rectangle offset = new(de.X - _dragBase.
X
, de.Y - _dragBase.Y, 0, 0);
968
Point newOffset = _forceDrawFrames ? convertedPoint : new Point(de.X - _dragBase.
X
, de.Y - _dragBase.Y);
System\Windows\Forms\Design\ParentControlDesigner.cs (27)
312
displayRectangle.X += offset.
X
; // offset for non-client area
465
bounds.X = location.
X
;
490
bounds.X = DefaultControlLocation.
X
;
496
bounds.X = selectedControl.Location.
X
+ GridSize.Width;
581
pt.Offset(-ptScroll.
X
, -ptScroll.Y); // always want to add the control below/right of the AutoScrollPosition
802
CreateToolCore(tool, location.
X
, location.Y, 0, 0, true, false);
925
centeredLocation.X = DefaultControlLocation.
X
;
1104
if (adjustedRect.X < minimumLocation.
X
)
1106
adjustedRect.X = minimumLocation.
X
;
1120
Rectangle r = GetUpdatedRect(Rectangle.Empty, new Rectangle(pt.
X
, pt.Y, 0, 0), false);
1151
if (dragRect.X - updatedRect.X > halfGrid.
X
)
1783
Rectangle frameRect = new(offset.X - _adornerWindowToScreenOffset.
X
,
1823
Point location = new(baseVar.
X
, baseVar.Y);
1825
_statusCommandUI?.SetStatusInformation(new Rectangle(location.
X
, location.Y, offset.Width, offset.Height));
1920
_mouseDragOffset.X = _mouseDragBase.
X
;
1922
_mouseDragOffset.Width = x - _mouseDragBase.
X
;
1938
Rectangle r = new(_mouseDragBase.
X
- _adornerWindowToScreenOffset.
X
,
1940
x - _mouseDragBase.
X
, y - _mouseDragBase.Y);
1942
_mouseDragOffset.Width += offset.
X
;
1975
Rectangle frameRect = new(_mouseDragOffset.X - _adornerWindowToScreenOffset.
X
,
1989
oldFrameRect.X -= _adornerWindowToScreenOffset.
X
;
2016
_statusCommandUI?.SetStatusInformation(new Rectangle(offset.
X
, offset.Y, _mouseDragOffset.Width, _mouseDragOffset.Height));
2191
newLoc = new Point(controlLoc.
X
- parentLoc.
X
, controlLoc.Y - parentLoc.Y);
2196
newLoc = new Point(controlLoc.
X
+ oldParentLoc.
X
, controlLoc.Y + oldParentLoc.Y);
System\Windows\Forms\Design\ScrollableControlDesigner.cs (1)
33
int hitTest = (int)PInvokeCore.SendMessage(f, PInvokeCore.WM_NCHITTEST, 0, PARAM.FromLowHigh(pt.
X
, pt.Y));
System\Windows\Forms\Design\SelectionUIHandler.cs (3)
426
leftProp.SetValue(component, adjustedLoc.
X
);
430
controls[i].Left = adjustedLoc.
X
;
617
X = loc.
X
;
System\Windows\Forms\Design\SelectionUIService.cs (13)
527
if (((ISelectionUIService)this).BeginDrag(rules, anchor.
X
, anchor.Y))
571
if (((ISelectionUIService)this).BeginDrag(rules, anchor.
X
, anchor.Y))
631
Math.Abs(screenCoord.
X
- _mouseDragAnchor.
X
) < minDragSize.Width &&
639
if (((ISelectionUIService)this).BeginDrag(_dragRules, _mouseDragAnchor.
X
, _mouseDragAnchor.Y))
655
_mouseDragOffset.X = screenCoord.
X
- _mouseDragAnchor.
X
;
667
_mouseDragOffset.X = screenCoord.
X
- _mouseDragAnchor.
X
;
668
_mouseDragOffset.Width = _mouseDragAnchor.
X
- screenCoord.
X
;
672
_mouseDragOffset.Width = screenCoord.
X
- _mouseDragAnchor.
X
;
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (20)
247
if (pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X)
272
Debug.Assert(!(pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X), "Should be handled by left top check");
273
if (pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width)
278
if (pt.
X
>= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2
279
&& pt.
X
<= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2)
287
if (pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width)
308
Debug.Assert(!(pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X), "Should be handled by left bottom check");
310
Debug.Assert(!(pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width), "Should be handled by right bottom check");
312
if (pt.
X
>= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2 && pt.
X
<= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2)
390
if (pt.
X
< _outerRect.X || pt.
X
> _outerRect.X + _outerRect.Width)
400
if (pt.
X
> _innerRect.X
401
&& pt.
X
< _innerRect.X + _innerRect.Width
System\Windows\Forms\Design\StatusCommandUI.cs (1)
57
bounds.X = location.
X
;
System\Windows\Forms\Design\TabControlDesigner.cs (1)
622
x = p.
X
;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (14)
497
Control existingControl = ((TableLayoutPanel)Control).GetControlFromPosition(newControlPosition.
X
, newControlPosition.Y);
583
AddControlInternal(existingControl, oldPosition.
X
, oldPosition.Y);
593
AddControlInternal(control, newControlPosition.
X
, newControlPosition.Y);
598
Table.SetCellPosition(control, new TableLayoutPanelCellPosition(newControlPosition.
X
, newControlPosition.Y));
980
if (pos.
X
<= bounds.X)
984
else if (pos.
X
< bounds.Right)
992
if (pos.
X
>= offset - columns[i])
1003
if (pos.
X
>= bounds.Right)
1007
else if (pos.
X
> bounds.X)
1013
if (pos.
X
<= offset + columns[i])
1270
if (dropPoint.Y < 0 || dropPoint.Y >= rows.Length || dropPoint.
X
< 0 || dropPoint.
X
>= columns.Length)
1277
Control existingControl = ((TableLayoutPanel)Control).GetControlFromPosition(dropPoint.
X
, dropPoint.Y);
1298
_curCol = cell.
X
;
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1854
if (offset.
X
>= parentToolStrip.Items[0].Bounds.X)
1859
else if (offset.
X
<= parentToolStrip.Items[0].Bounds.X)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (3)
569
if (dragBox != Rectangle.Empty && !dragBox.Contains(mouseLoc.
X
, mouseLoc.Y))
982
parentDesigner.DragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.
X
- (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
1005
ownerItemDesigner._dragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.
X
- (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (1)
492
x = p.
X
;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
1376
dropDownItem.DropDown.Location = new Point(dropDownItem.DropDown.Location.
X
+ _commitedEditorNode.Bounds.Width - dropDownItem.Bounds.Width, dropDownItem.DropDown.Location.Y);
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\DesignerUtilsTests.cs (2)
169
cursorPoint.
X
.Should().BeLessThanOrEqualTo(SystemInformation.VirtualScreen.Right);
170
cursorPoint.
X
.Should().BeGreaterThanOrEqualTo(SystemInformation.VirtualScreen.Left);
System.Windows.Forms.Primitives (23)
System\Windows\Forms\Automation\UiaTextRange.cs (16)
364
Rectangle endlineRectangle = new(endlinePoint.
X
, endlinePoint.Y + 2, UiaTextProvider.EndOfLineWidth, Math.Abs(_provider.Logfont.lfHeight) + 1);
400
Rectangle rectangle = new(startPoint.
X
, startPoint.Y + 2, endPoint.
X
- startPoint.
X
, clippingRectangle.Height);
405
rectangle.Offset(mapClientToScreen.
X
, mapClientToScreen.Y);
794
|| lineEndPoint.
X
> clippingRectangle.Right))
803
if (lineEndPoint.
X
<= lineStartPoint.
X
&& lineTextLength > 0)
831
int minX = lineEndPoint.
X
;
838
if (pt.
X
< minX)
840
minX = pt.
X
;
845
if (pt.
X
> maxX)
847
maxX = pt.
X
;
866
Rectangle rect = new(startPoint.
X
, startPoint.Y + 2, endPoint.
X
- startPoint.
X
, lineHeight);
System\Windows\Forms\DeviceContextExtensions.cs (5)
54
DrawLine(hdc.HDC, hpen, p1.
X
, p1.Y, p2.
X
, p2.Y);
57
DrawLine(hdc, hpen, p1.
X
, p1.Y, p2.
X
, p2.Y);
94
PInvoke.MoveToEx(hdc, oldPoint.
X
, oldPoint.Y, lppt: null);
Windows\Win32\Foundation\Interop.PARAM.cs (1)
66
=> FromLowHigh(point.
X
, point.Y);
Windows\Win32\UI\Accessibility\UiaPoint.cs (1)
12
public static implicit operator UiaPoint(Point value) => new() { x = value.
X
, y = value.Y };
System.Windows.Forms.Primitives.TestUtilities (2)
Extensions\GdiExtensions.cs (1)
22
float x = point.
X
;
Metafiles\RecordTypes\EMREXTCREATEPEN.cs (1)
41
elpWidth = (uint)logPen.lopnWidth.
X
,
System.Windows.Forms.Tests (154)
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (1)
414
Assert.Equal(expectedPosition.
X
, actual.X);
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (1)
348
var result = listBox.AccessibilityObject.HitTest(testPoint.
X
, testPoint.Y);
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (2)
1181
Assert.Null(listView.AccessibilityObject.HitTest(point.
X
, point.Y));
1381
listView.AccessibilityObject.HitTest(point.
X
, point.Y);
System\Windows\Forms\AccessibleObjects\TabControl.TabControlAccessibleObjectTests.cs (3)
298
Assert.Equal(expectedAccessibleObject, accessibleObject.HitTest(point.
X
, point.Y));
316
Assert.Equal(expectedAccessibleObject, accessibleObject.HitTest(point.
X
, point.Y));
334
Assert.Equal(expectedAccessibleObject, accessibleObject.HitTest(point.
X
, point.Y));
System\Windows\Forms\AccessibleObjects\TrackBar.TrackBarAccessibleObjectTests.cs (3)
527
accessibleObject.HitTest(pointInThumb.
X
, pointInThumb.Y).Should().Be(accessibleObject.ThumbAccessibleObject);
532
accessibleObject.HitTest(pointInFirstButton.
X
, pointInFirstButton.Y).Should().Be(accessibleObject.FirstButtonAccessibleObject);
538
accessibleObject.HitTest(pointInLastButton.
X
, pointInLastButton.Y).Should().Be(accessibleObject.LastButtonAccessibleObject);
System\Windows\Forms\AccessibleObjects\TreeView.TreeViewAccessibleObjectTests.cs (3)
238
Assert.Null(accessibleObject.HitTest(point.
X
, point.Y));
253
Assert.Equal(accessibleObject, accessibleObject.HitTest(point.
X
, point.Y));
267
Assert.Equal(node.AccessibilityObject, control.AccessibilityObject.HitTest(point.
X
, point.Y));
System\Windows\Forms\CheckBoxRendererTests.cs (4)
30
Point point = new(control.Location.
X
, control.Location.Y);
66
Point point = new(control.Location.
X
, control.Location.Y);
103
Point point = new(control.Location.
X
, control.Location.Y);
137
Point point = new(control.Location.
X
, control.Location.Y);
System\Windows\Forms\ComboBox.ComboBoxUiaTextProviderTests.cs (8)
444
Assert.True(actualPoint.
X
>= expectedPoint.
X
- 1 || actualPoint.
X
<= expectedPoint.
X
+ 1);
510
Assert.True(actualPoint.
X
>= expectedPoint.
X
- 1 || actualPoint.
X
<= expectedPoint.
X
+ 1);
System\Windows\Forms\ComboBoxTests.cs (1)
2778
public void OnMouseDown(Point p) => base.OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1, p.
X
, p.Y, 0));
System\Windows\Forms\ControlTests.Methods.cs (4)
12520
yield return new object[] { new Size(10, 20), PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250, true };
12526
yield return new object[] { Size.Empty, PARAM.FromLowHigh(p.
X
, p.Y), IntPtr.Zero, true };
12594
yield return new object[] { new Size(10, 20), PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250 };
12600
yield return new object[] { Size.Empty, PARAM.FromLowHigh(p.
X
, p.Y), IntPtr.Zero };
System\Windows\Forms\ControlTests.Properties.cs (24)
7178
Assert.Equal(value.
X
, control.Left);
7179
Assert.Equal(value.
X
, control.Right);
7185
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7200
Assert.Equal(value.
X
, control.Left);
7201
Assert.Equal(value.
X
, control.Right);
7207
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7268
Assert.Equal(value.
X
, control.Left);
7269
Assert.Equal(value.
X
, control.Right);
7275
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7291
Assert.Equal(value.
X
, control.Left);
7292
Assert.Equal(value.
X
, control.Right);
7298
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7370
Assert.Equal(value.
X
, control.Left);
7371
Assert.Equal(value.
X
, control.Right);
7377
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7395
Assert.Equal(value.
X
, control.Left);
7396
Assert.Equal(value.
X
, control.Right);
7402
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7481
Assert.Equal(value.
X
, control.Left);
7482
Assert.Equal(value.
X
, control.Right);
7488
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
7511
Assert.Equal(value.
X
, control.Left);
7512
Assert.Equal(value.
X
, control.Right);
7518
Assert.Equal(new Rectangle(value.
X
, value.Y, 0, 0), control.Bounds);
System\Windows\Forms\CursorsTests.cs (2)
56
Assert.True(hotSpot.
X
>= 0 && hotSpot.
X
<= cursor.Size.Width);
System\Windows\Forms\CursorTests.cs (6)
234
Assert.True(hotSpot.
X
>= 0 && hotSpot.
X
<= cursor.Size.Width);
268
Assert.True(position.
X
>= virtualScreen.X);
270
Assert.True(position.
X
<= virtualScreen.Right);
282
Assert.True(position.
X
>= 0);
288
Assert.True(position.
X
>= virtualScreen.X);
System\Windows\Forms\ImageListTests.cs (1)
978
list.Draw(graphics, pt.
X
, pt.Y, 0);
System\Windows\Forms\ListViewInsertionMarkTests.cs (1)
616
Assert.Equal(1, pPt->
X
);
System\Windows\Forms\MonthCalendarTests.cs (1)
4494
hitTestInfo.Point.
X
.Should().Be(x);
System\Windows\Forms\PropertyGridInternal\PropertyGridViewTests.Rendering.cs (2)
50
Validate.TextOut(pt.
X
.ToString(), new(145, 22, 5, 14), stateValidators: State.FontFace(Control.DefaultFont.Name))),
53
Validate.TextOut(nameof(Point.
X
), new(25, 23, 6, 14), stateValidators: State.FontFace(Control.DefaultFont.Name))),
System\Windows\Forms\RadioButtonRendererTests.cs (4)
28
Point point = new(control.Location.
X
, control.Location.Y);
59
Point point = new(control.Location.
X
, control.Location.Y);
96
Point point = new(control.Location.
X
, control.Location.Y);
123
Point point = new(control.Location.
X
, control.Location.Y);
System\Windows\Forms\SplitterPanelTests.cs (6)
546
Assert.Equal(value.
X
, control.Left);
547
Assert.Equal(value.
X
+ 200, control.Right);
553
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
568
Assert.Equal(value.
X
, control.Left);
569
Assert.Equal(value.
X
+ 200, control.Right);
575
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
System\Windows\Forms\TabPageTests.cs (18)
1904
Assert.Equal(value.
X
, control.Left);
1905
Assert.Equal(value.
X
+ 200, control.Right);
1911
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
1926
Assert.Equal(value.
X
, control.Left);
1927
Assert.Equal(value.
X
+ 200, control.Right);
1933
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
1994
Assert.Equal(value.
X
, control.Left);
1995
Assert.Equal(value.
X
+ 200, control.Right);
2001
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
2017
Assert.Equal(value.
X
, control.Left);
2018
Assert.Equal(value.
X
+ 200, control.Right);
2024
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
2095
Assert.Equal(value.
X
, control.Left);
2096
Assert.Equal(value.
X
+ 200, control.Right);
2102
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
2120
Assert.Equal(value.
X
, control.Left);
2121
Assert.Equal(value.
X
+ 200, control.Right);
2127
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
System\Windows\Forms\TextBoxBase.TextBoxBaseUiaTextProviderTests.cs (8)
408
Assert.True(actualPoint.
X
>= expectedPoint.
X
- 1 || actualPoint.
X
<= expectedPoint.
X
+ 1);
452
Assert.True(actualPoint.
X
>= expectedPoint.
X
- 1 || actualPoint.
X
<= expectedPoint.
X
+ 1);
System\Windows\Forms\ToolStripContentPanelTests.cs (6)
945
Assert.Equal(value.
X
, control.Left);
946
Assert.Equal(value.
X
+ 200, control.Right);
952
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
967
Assert.Equal(value.
X
, control.Left);
968
Assert.Equal(value.
X
+ 200, control.Right);
974
Assert.Equal(new Rectangle(value.
X
, value.Y, 200, 100), control.Bounds);
System\Windows\Forms\ToolStripDropDownTests.cs (7)
1933
expected.X = Math.Max(expected.
X
, SystemInformation.WorkingArea.X);
1971
Assert.Equal(expected.
X
, control.Left);
1972
Assert.Equal(expected.
X
+ 100, control.Right);
1978
Assert.Equal(new Rectangle(expected.
X
, expected.Y, 100, 25), control.Bounds);
1993
Assert.Equal(expected.
X
, control.Left);
1994
Assert.Equal(expected.
X
+ 100, control.Right);
2000
Assert.Equal(new Rectangle(expected.
X
, expected.Y, 100, 25), control.Bounds);
System\Windows\Forms\TreeViewTests.cs (24)
4922
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
4926
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
4937
Assert.Same(node1, control.GetNodeAt(pt.
X
, pt.Y));
4941
Assert.Same(node1, control.GetNodeAt(pt.
X
, pt.Y));
4952
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
4956
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
4973
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
4980
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
5002
Assert.Same(node1, control.GetNodeAt(pt.
X
, pt.Y));
5009
Assert.Same(node1, control.GetNodeAt(pt.
X
, pt.Y));
5031
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
5038
Assert.Null(control.GetNodeAt(pt.
X
, pt.Y));
5270
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5276
result = control.HitTest(pt.
X
, pt.Y);
5289
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5295
result = control.HitTest(pt.
X
, pt.Y);
5308
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5314
result = control.HitTest(pt.
X
, pt.Y);
5333
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5342
result = control.HitTest(pt.
X
, pt.Y);
5366
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5375
result = control.HitTest(pt.
X
, pt.Y);
5399
TreeViewHitTestInfo result = control.HitTest(pt.
X
, pt.Y);
5408
result = control.HitTest(pt.
X
, pt.Y);
System\Windows\Forms\WebBrowserTests.cs (4)
4531
yield return new object[] { new Size(10, 20), PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250, true };
4537
yield return new object[] { Size.Empty, PARAM.FromLowHigh(p.
X
, p.Y), IntPtr.Zero, true };
4605
yield return new object[] { new Size(10, 20), PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250 };
4611
yield return new object[] { Size.Empty, PARAM.FromLowHigh(p.
X
, p.Y), IntPtr.Zero };
TextBoxBaseTests.cs (10)
4858
Assert.True(pt.
X
> 0);
4919
Assert.True(pt.
X
> 0);
6984
yield return new object[] { new Size(10, 20), shortcutsEnabled, PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250, true, true };
6990
yield return new object[] { Size.Empty, shortcutsEnabled, PARAM.FromLowHigh(p.
X
, p.Y), expectedResult, false, true };
7065
yield return new object[] { new Size(10, 20), shortcutsEnabled, PARAM.FromLowHigh(p.
X
, p.Y), (IntPtr)250, true };
7071
yield return new object[] { Size.Empty, shortcutsEnabled, PARAM.FromLowHigh(p.
X
, p.Y), expectedResult, false };
7829
Assert.True(actualPoint.
X
>= expectedPoint.
X
- 1 || actualPoint.
X
<= expectedPoint.
X
+ 1);
System.Windows.Forms.UI.IntegrationTests (85)
ButtonTests.cs (6)
262
Point virtualPoint = new((int)Math.Round(65535.0 / horizontalResolution * centerOnScreen.
X
),
269
.MoveMouseTo(virtualPoint.
X
, virtualPoint.Y)
298
Point virtualPoint = new((int)Math.Round(65535.0 / horizontalResolution * centerOnScreen.
X
), (int)Math.Round(65535.0 / verticalResolution * centerOnScreen.Y));
299
Point virtualPoint1 = new((int)Math.Round(65535.0 / horizontalResolution * centerOnScreen1.
X
), (int)Math.Round(65535.0 / verticalResolution * centerOnScreen1.Y));
304
.MoveMouseTo(virtualPoint.
X
, virtualPoint.Y)
305
.MoveMouseTo(virtualPoint1.
X
, virtualPoint1.Y)
DataGridViewTests.cs (2)
35
inputSimulator => inputSimulator.Mouse.MoveMouseTo(targetPoint.
X
, targetPoint.Y));
115
inputSimulator => inputSimulator.Mouse.MoveMouseTo(targetPoint.
X
, targetPoint.Y).Sleep(TimeSpan.FromMilliseconds(1000)));
DesignBehaviorsTests.cs (2)
128
inputSimulator => inputSimulator.Mouse.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
130
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
DragDropTests.cs (62)
47
.MoveMouseTo(targetMousePosition.
X
- 40, targetMousePosition.Y)
48
.MoveMouseTo(targetMousePosition.
X
, targetMousePosition.Y)
49
.MoveMouseTo(targetMousePosition.
X
+ 2, targetMousePosition.Y + 2)
50
.MoveMouseTo(targetMousePosition.
X
+ 4, targetMousePosition.Y + 4)
102
Point endCoordinates = new(startCoordinates.
X
+ 5, startCoordinates.Y + 5);
110
.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
112
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
113
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
114
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
115
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
168
WaitForExplorer(DragDrop, new Point(dragDropForm.Location.
X
+ dragDropForm.Width, dragDropForm.Location.Y));
198
X = (startCoordinates.
X
- vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2),
203
X = (endCoordinates.
X
- vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2),
258
.MoveMouseToPositionOnVirtualDesktop(virtualPointStart.
X
, virtualPointStart.Y)
260
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
, virtualPointEnd.Y)
261
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
262
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
263
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
264
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
265
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
266
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
267
.MoveMouseToPositionOnVirtualDesktop(virtualPointEnd.
X
, virtualPointEnd.Y)
317
Point endCoordinates = new(startCoordinates.
X
+ 5, startCoordinates.Y + 5);
325
.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
327
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
328
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
329
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
330
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
388
.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
390
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
391
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
392
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
393
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
394
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
395
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
396
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
397
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
404
.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
406
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
407
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
408
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
409
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
410
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
411
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
412
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
413
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
436
inputSimulator => inputSimulator.Mouse.MoveMouseTo(virtualPointStart.
X
, virtualPointStart.Y)
438
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
472
inputSimulator => inputSimulator.Mouse.MoveMouseTo(virtualToolStripItemCoordinates.
X
, virtualToolStripItemCoordinates.Y));
479
inputSimulator => inputSimulator.Mouse.MoveMouseTo(virtualPointStart.
X
, virtualPointStart.Y)
481
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
527
Point endCoordinates = new(startCoordinates.
X
+ 5, startCoordinates.Y + 5);
535
.MoveMouseTo(virtualPointStart.
X
+ 6, virtualPointStart.Y + 6)
537
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
538
.MoveMouseTo(virtualPointEnd.
X
, virtualPointEnd.Y)
539
.MoveMouseTo(virtualPointEnd.
X
+ 2, virtualPointEnd.Y + 2)
540
.MoveMouseTo(virtualPointEnd.
X
+ 4, virtualPointEnd.Y + 4)
627
startPosition.
X
,
915
if (((MousePosition.
X
- _screenOffset.
X
) < form.DesktopBounds.Left) ||
916
((MousePosition.
X
- _screenOffset.
X
) > form.DesktopBounds.Right) ||
Infra\ControlTestBase.cs (6)
176
(int)Math.Ceiling((65535.0 / (primaryMonitor.Width - 1)) * point.
X
),
182
TestOutputHelper.WriteLine($"Moving mouse to ({point.
X
}, {point.Y}).");
185
TestOutputHelper.WriteLine($"Screen resolution of ({primaryMonitor.Width}, {primaryMonitor.Height}) translates mouse to ({virtualPoint.
X
}, {virtualPoint.Y}).");
187
await InputSimulator.SendAsync(window, inputSimulator => inputSimulator.Mouse.MoveMouseTo(virtualPoint.
X
, virtualPoint.Y));
197
if (actualPoint.
X
!= point.
X
|| actualPoint.Y != point.Y)
Input\MouseSimulator.cs (1)
137
return MoveMouseTo(virtualPoint.
X
, virtualPoint.Y);
ListBoxAccesibleObjectTests.cs (2)
41
var result = listBox.AccessibilityObject.HitTest(testPoint.
X
, testPoint.Y);
57
var result = listBox.AccessibilityObject.HitTest(testPoint.
X
, testPoint.Y);
ListViewTests.cs (1)
325
listView.AccessibilityObject.HitTest(point.
X
, point.Y)!;
PropertyGridTests.cs (3)
232
_propertyGrid.ContextMenuDefaultLocation.
X
.Should().Be(oldLocation.
X
+ newLocation.
X
);
WinFormsControlsTest (1)
MainForm.cs (1)
294
((biggestButton.Width + (padding * 2)) * 3) + (padding * 2) + (overarchingFlowLayoutPanel.Location.
X
* 2),