166 writes to X
System.Drawing.Primitives (1)
System\Drawing\Point.cs (1)
155
X
+= dx;
System.Windows.Forms (104)
System\Resources\ResXResourceReader.cs (1)
330
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)
2366
ptFirstDisplayedCellAddress.
X
= FirstDisplayedColumnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (19)
12668
_ptMouseEnteredCell.
X
= e.ColumnIndex;
12691
_ptMouseEnteredCell.
X
= -2;
16180
_ptMouseDownCell.
X
= hti._col;
16231
_ptMouseEnteredCell.
X
= _ptMouseEnteredCell.Y = -2;
17460
_ptCurrentCellCache.
X
= -1;
17471
_ptCurrentCellCache.
X
= _ptCurrentCell.X;
17479
_ptCurrentCellCache.
X
= -1;
18880
pt.
X
+= Width;
25916
_ptMouseDownCell.
X
= -2;
26695
_ptAnchorCell.
X
= dataGridViewColumn.Index;
26700
_ptAnchorCell.
X
= -1;
26861
_ptCurrentCell.
X
= columnIndex;
26995
_ptCurrentCell.
X
= columnIndex;
27005
_ptAnchorCell.
X
= columnIndex;
27067
_ptAnchorCell.
X
= columnIndex;
27155
_ptCurrentCell.
X
= -1;
27162
_ptAnchorCell.
X
= -1;
28293
_ptCurrentCellCache.
X
= _ptCurrentCell.X;
29274
_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)
2206
lvhi.pt.
X
+= si.nPos;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
1452
location.
X
= Math.Min(
1690
pt.
X
= RowValue;
3844
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)
384
noMansLand.
X
+= ClientSize.Width + 1;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
4512
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)
3453
toPoint.
X
+= currentToolStripItemLocation.X;
3465
fromPoint.
X
+= currentToolStripItemLocation.X;
3480
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)
1273
start.
X
= overflowBoundsFill.Right + 1;
1274
end.
X
= overflowBoundsFill.Right;
1302
top1.
X
= overflowBoundsFill.Right + 1;
1303
top2.
X
= overflowBoundsFill.Right;
1650
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)
923
loc.
X
-= screen.X;
3920
p.
X
= (ownerRect.left + ownerRect.right - s.Width) / 2;
3923
p.
X
= screenRect.X;
3927
p.
X
= screenRect.X + screenRect.Width - s.Width;
3974
p.
X
= Math.Max(screenRect.X, screenRect.X + (screenRect.Width - Width) / 2);
6951
mmi->ptMinTrackSize.
X
= minTrack.Width;
6974
mmi->ptMaxTrackSize.
X
= int.MaxValue;
6983
mmi->ptMaxTrackSize.
X
= Math.Max(maxTrack.Width, minTrackWindowSize.Width);
6989
mmi->ptMaxPosition.
X
= maximizedBounds.X;
6991
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)
640
_position.
X
= _hScrollBar.Value;
649
offset.
X
-= Position.X;
664
lastImageSize.
X
= 0;
688
lastImageSize.
X
+= imagePixels.Width;
959
locPos.
X
= pos;
993
locPos.
X
= pos;
1071
locPos.
X
= pos;
1091
locPos.
X
= pos;
System\Windows\Forms\ToolTip\ToolTip.cs (3)
1337
p.
X
= visibleRect.left + visibleRect.Width / 2;
1933
moveToLocation.
X
= screen.WorkingArea.Right - tipSize.Width;
1938
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;
770
newPosition.
X
+= _lastSnapOffset.X;
784
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)
127
offset.
X
= _lastRectangle.Left - mouseLoc.X;
133
offset.
X
= _lastRectangle.Right - mouseLoc.X;
185
offset.
X
= _lastRectangle.Left - mouseLoc.X;
191
offset.
X
= _lastRectangle.Right - mouseLoc.X;
210
offset.
X
= _lastRectangle.Left - mouseLoc.X;
System\Windows\Forms\Design\CommandSet.cs (20)
1053
loc.
X
= primaryLocation.X + primarySize.Width - size.Width;
1061
loc.
X
= primarySize.Width / 2 + primaryLocation.X - size.Width / 2;
1070
loc.
X
= primaryLocation.X;
1185
loc.
X
-= delta;
1189
loc.
X
+= (gridSize.Width - delta);
1344
loc.
X
+= deltaX;
1346
loc.
X
-= deltaX;
2427
loc.
X
= (loc.X / grid.Width) * grid.Width;
2794
curLoc.
X
= lastLoc.X + lastSize.Width;
2800
curLoc.
X
-= grid.Width * (n - primaryIndex);
2802
curLoc.
X
= primaryLoc.X;
2806
curLoc.
X
+= grid.Width * (primaryIndex - n);
2808
curLoc.
X
= primaryLoc.X;
2815
curLoc.
X
+= grid.Width * (n - primaryIndex);
2819
curLoc.
X
-= grid.Width * (primaryIndex - n);
2824
curLoc.
X
= lastLoc.X + lastSize.Width + nEqualDelta;
3248
min.
X
= loc.X;
3258
max.
X
= loc.X + size.Width;
3287
parentOffset.
X
-= (max.X - min.X) / 2;
3380
parentOffset.
X
= 0;
System\Windows\Forms\Design\ComponentTray.cs (3)
1296
_mouseDragEnd.
X
= e.X;
1810
_whiteSpace.
X
= _whiteSpace.X * 2 + 3;
1850
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;
976
position.
X
= columns.Length;
985
position.
X
= i;
999
position.
X
= columns.Length;
1006
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;
1483 references to X
Microsoft.Private.Windows.Core (4)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Windows.Win32.RECT.g.cs (2)
45
this(location.
X
, location.Y, unchecked(location.
X
+ size.Width), unchecked(location.Y + size.Height))
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
145
value.
X
,
Windows\Win32\Foundation\LPARAM.cs (1)
28
public static explicit operator LPARAM(Point value) => MAKELPARAM(value.
X
, value.Y);
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.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 (4)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Windows.Win32.RECT.g.cs (2)
45
this(location.
X
, location.Y, unchecked(location.
X
+ size.Width), unchecked(location.Y + size.Height))
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
145
value.
X
,
Windows\Win32\Foundation\LPARAM.cs (1)
28
public static explicit operator LPARAM(Point value) => MAKELPARAM(value.
X
, value.Y);
System.Windows.Forms (1088)
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)
376
string newMessage = string.Format(SR.SerializationException, reader[ResXResourceWriter.TypeStr], pt.Y, pt.
X
, se.Message);
377
XmlException xml = new(newMessage, se, pt.Y, pt.
X
);
383
string newMessage = string.Format(SR.InvocationException, reader[ResXResourceWriter.TypeStr], pt.Y, pt.
X
, tie.InnerException?.Message);
384
XmlException xml = new(newMessage, tie.InnerException, pt.Y, pt.
X
);
400
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)
1093
sz.Width = phm.
X
;
3256
Bounds = new Rectangle(location.
X
, location.Y, ocxExtent.Width, ocxExtent.Height);
3263
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\Components\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
180
PInvoke.SetViewportOrgEx(hdc, originalOrigin.
X
+ _windowBounds.Width - 1, originalOrigin.Y, lppt: null);
System\Windows\Forms\Components\ImageList\ImageList.cs (1)
510
public void Draw(Graphics g, Point pt, int index) => Draw(g, pt.
X
, pt.Y, index);
System\Windows\Forms\Control.cs (7)
1771
if ((r.left <= p.
X
&& p.
X
< r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND)
2697
set => SetBounds(value.
X
, value.Y, _width, _height, BoundsSpecified.Location);
8672
cliprect.Offset(-offs.
X
, -offs.Y);
9591
viewportOrg.
X
,
9593
viewportOrg.
X
+ Width,
9620
clientOffset = new(clientOffset.
X
- windowRect.left, clientOffset.Y - windowRect.top);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
456
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)
1685
OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1, Ptlc.
X
, Ptlc.Y, 0));
1702
OnMouseDown(new MouseEventArgs(MouseButtons.Middle, 1, Ptmc.
X
, Ptmc.Y, 0));
1719
OnMouseDown(new MouseEventArgs(MouseButtons.Right, 1, Ptrc.
X
, Ptrc.Y, 0));
1733
OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1, Ptl.
X
, Ptl.Y, 0));
1778
OnMouseDown(new MouseEventArgs(MouseButtons.Middle, 1, P.
X
, P.Y, 0));
1795
OnMouseDown(new MouseEventArgs(MouseButtons.Right, 1, Pt.
X
, Pt.Y, 0));
1815
OnMouseUp(new MouseEventArgs(MouseButtons.Right, 1, ptRBtnUp.
X
, ptRBtnUp.Y, 0));
1837
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\ComboBox\ComboBox.ModernComboAdapter.cs (3)
248
new(center.
X
- halfWidth, center.Y - halfHeight),
249
new(center.
X
, center.Y + halfHeight),
250
new(center.
X
+ halfWidth, center.Y - halfHeight)
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)
1136
if (_ptCurrentCell.
X
!= -1 && ColumnEditable(_ptCurrentCell.
X
))
1712
if (_ptCurrentCell.
X
== -1 && _ptCurrentCell.Y == -1)
1717
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.Y >= 0);
1718
Debug.Assert(_ptCurrentCell.
X
< Columns.Count);
1721
return dataGridViewRow.Cells[_ptCurrentCell.
X
];
1725
if ((value is not null && (value.RowIndex != _ptCurrentCell.Y || value.ColumnIndex != _ptCurrentCell.
X
))
1726
|| (value is null && _ptCurrentCell.
X
!= -1))
1786
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.
X
< Columns.Count);
1790
DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[_ptCurrentCell.
X
];
1800
if (_ptCurrentCell.
X
== -1)
1807
bool previousVisibleColumnExists = (Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1818
if (_ptCurrentCell.
X
== -1)
1825
bool nextVisibleColumnExists = (Columns.GetNextColumn(Columns[_ptCurrentCell.
X
], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1836
if (_ptCurrentCell.
X
== -1)
1854
if (_ptCurrentCell.
X
== -1)
2291
if (firstDisplayedCellAddress.
X
>= 0)
2293
return Rows[firstDisplayedCellAddress.Y].Cells[firstDisplayedCellAddress.
X
]; // un-shares the row of first displayed cell
2492
if (_ptCurrentCell.
X
>= 0
2572
if (_ptCurrentCell.
X
>= 0
2749
&& !Columns[_ptCurrentCell.
X
].Frozen
2854
=> _ptCurrentCell.
X
== -1 ? null : CurrentCellInternal.GetInheritedStyleInternal(_ptCurrentCell.Y);
3075
if (value && _ptCurrentCell.
X
!= -1 && IsCurrentCellInEditMode)
3147
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 (682)
67
if (cellAddress.
X
< 0 || cellAddress.
X
>= Columns.Count)
78
int visibleColumnIndex = Columns.ColumnIndexToActualDisplayIndex(cellAddress.
X
, DataGridViewElementStates.Visible);
2609
public virtual bool BeginEdit(bool selectAll) => _ptCurrentCell.
X
== -1
2623
Debug.Assert(_ptCurrentCell.
X
>= 0 && _ptCurrentCell.
X
< Columns.Count);
2630
if (IsSharedCellReadOnly(dataGridViewCell, _ptCurrentCell.Y) || !ColumnEditable(_ptCurrentCell.
X
))
2646
DataGridViewCellCancelEventArgs dgvcce = new(_ptCurrentCell.
X
, _ptCurrentCell.Y);
2655
if (_ptCurrentCell.
X
> -1)
2663
if (IsSharedCellReadOnly(dataGridViewCell, _ptCurrentCell.Y) || !ColumnEditable(_ptCurrentCell.
X
))
2764
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
3097
if (_ptCurrentCell.
X
!= -1)
3101
int oldCurrentCellX = _ptCurrentCell.
X
;
3159
_ptCurrentCell.
X
,
3185
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
3189
else if (_ptCurrentCell.
X
== -1 && Focused)
3259
int oldCurrentCellX = _ptCurrentCell.
X
;
3264
if (currentCellDirty || _ptCurrentCell.Y == -1 || _ptCurrentCell.
X
== -1)
3363
if (_ptCurrentCell.
X
> -1)
3478
if (_ptCurrentCell.
X
!= -1 && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
3480
InvalidateCellPrivate(_ptCurrentCell.
X
, -1);
3816
Debug.Assert(_ptCurrentCell.
X
> -1);
3819
if (_ptCurrentCell.
X
== -1)
3824
OnCellLeave(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3829
if (_ptCurrentCell.
X
== -1)
3834
OnRowLeave(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3845
if (_ptCurrentCell.
X
> -1 && _ptCurrentCell.Y > -1)
3847
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
3855
if (_ptCurrentCell.
X
== -1)
3860
if (OnCellValidating(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y, context))
3864
if (_ptCurrentCell.
X
== -1)
3871
_ptCurrentCell.
X
,
3879
if (_ptCurrentCell.
X
== -1)
3884
OnCellEnter(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3887
if (_ptCurrentCell.
X
== -1)
3894
_ptCurrentCell.
X
,
3905
if (_ptCurrentCell.
X
== -1)
3910
OnCellValidated(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
3915
if (_ptCurrentCell.
X
== -1 || !IsCurrentCellInEditMode)
3931
Debug.Assert(_ptCurrentCell.
X
> -1);
3932
if (_ptCurrentCell.
X
== -1)
3937
if (OnCellValidating(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y, context))
3939
if (_ptCurrentCell.
X
== -1)
3946
_ptCurrentCell.
X
,
3971
if (_ptCurrentCell.
X
== -1)
3978
_ptCurrentCell.
X
,
4013
if (_ptCurrentCell.
X
== -1)
4018
OnCellValidated(ref dataGridViewCurrentCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
4078
Debug.Assert(_ptCurrentCell.
X
> -1);
4079
if (_ptCurrentCell.
X
== -1)
4084
int columnIndex = _ptCurrentCell.
X
;
4142
int columnIndexTmp = _ptCurrentCell.
X
;
4214
if (forCurrentCellChange && _ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
5793
Debug.Assert(_ptCurrentCell.
X
!= -1);
5794
int adjustedX = _editingPanel.Location.
X
+ e.X;
5798
adjustedX += EditingControl.Location.
X
;
6006
Debug.Assert(_ptCurrentCell.
X
!= -1);
6016
Debug.Assert(_ptCurrentCell.
X
!= -1);
6218
if (_ptCurrentCell.
X
== -1)
6227
int curColIndex = _ptCurrentCell.
X
;
6271
if (curRowIndex != _ptCurrentCell.Y || curColIndex != _ptCurrentCell.
X
)
6295
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
6322
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
8745
if (_ptAnchorCell.
X
!= -1
8746
&& Columns[_ptAnchorCell.
X
].Frozen
8774
if (_ptAnchorCell.
X
!= -1
8775
&& (!Columns[_ptAnchorCell.
X
].Frozen || (_trackColumnEdge != -1 && !Columns[_trackColumnEdge].Frozen))
8926
if (((_ptAnchorCell.
X
!= -1 && !Columns[_ptAnchorCell.
X
].Frozen) || (_ptCurrentCell.
X
!= -1 && !Columns[_ptCurrentCell.
X
].Frozen))
9689
HitTestInfo hti = HitTest(ptMouse.
X
, ptMouse.Y);
9690
int mouseX = ptMouse.
X
, mouseY = ptMouse.Y;
9701
hti = HitTest(ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset), mouseY);
9711
ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset),
9713
: HitTest(ptMouse.
X
+ (RightToLeftInternal ? 1 : -1) * (xOffset + normOffset), mouseY);
9752
Debug.Assert(_ptCurrentCell.
X
== dataGridViewCell.ColumnIndex);
9753
dataGridViewCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
]; // un-share the edited cell
9763
_ptCurrentCell.
X
,
9795
_ptCurrentCell.
X
,
10166
&& _ptCurrentCell.
X
!= -1)
10446
if (firstDisplayedCellAddress.
X
!= -1
10450
firstDisplayedCellAddress.
X
,
11958
HitTestInfo hti = HitTest(ptGridCoord.
X
, ptGridCoord.Y);
11965
Debug.Assert(_ptMouseDownCell.
X
== hti._col);
12017
BeginMouseColumnResize(ptGridCoord.
X
, hti._mouseBarOffset, columnIndex);
12046
BeginColumnRelocation(ptGridCoord.
X
, hti._col);
12085
BeginRowHeadersResize(ptGridCoord.
X
, hti._mouseBarOffset);
12107
if (_ptCurrentCell.
X
== -1)
12124
if (_ptCurrentCell.
X
>= 0 && (_ptCurrentCell.
X
!= hti._col || _ptCurrentCell.Y != hti._row))
12129
forCurrentCellChange: _ptCurrentCell.
X
!= hti._col || _ptCurrentCell.Y != hti._row,
12149
if (_ptCurrentCell.
X
== -1 && dataGridViewLastVisibleColumn is not null)
12165
if (_ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
12211
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12213
if (_ptAnchorCell.
X
== -1)
12219
_ptAnchorCell.
X
,
12263
if (MultiSelect && isShiftDown && _ptAnchorCell.
X
> -1 && Columns[_ptAnchorCell.
X
].Selected)
12310
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, hti._col))
12312
SelectColumnRange(_ptAnchorCell.
X
, hti._col, true);
12316
SelectColumnRange(hti._col, _ptAnchorCell.
X
, true);
12401
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12403
if (_ptAnchorCell.
X
== -1)
12409
_ptAnchorCell.
X
,
12607
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12609
if (_ptAnchorCell.
X
== -1)
12615
_ptAnchorCell.
X
,
12736
&& _ptMouseDownCell.
X
>= 0
12737
&& _ptMouseDownCell.
X
< Columns.Count)
12741
HitTestInfo hti = HitTest(ptGridCoord.
X
, ptGridCoord.Y);
12756
if (Math.Abs(_ptMouseDownGridCoord.
X
- ptGridCoord.
X
) >= s_dragSize.Width
12759
BeginColumnRelocation(_ptMouseDownGridCoord.
X
, _ptMouseDownCell.
X
);
12821
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
12823
if ((hti._col != _ptCurrentCell.
X
|| hti._row != _ptCurrentCell.Y)
12833
if (_ptAnchorCell.
X
== -1 || IsInnerCellOutOfBounds(hti._col, hti._row))
12839
_ptAnchorCell.
X
,
12846
if (hti._col != _ptCurrentCell.
X
|| hti._row != _ptCurrentCell.Y)
12880
&& _ptCurrentCell.
X
== dataGridViewCell.ColumnIndex
12888
&& ColumnEditable(_ptCurrentCell.
X
)
13756
if (rowIndex > -1 && hti._col != _ptCurrentCell.
X
)
13759
int oldCurrentCellX = _ptCurrentCell.
X
;
13825
if (MultiSelect && isShiftDown && _ptAnchorCell.
X
> -1 && Columns[_ptAnchorCell.
X
].Selected)
13881
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, hti._col))
13883
SelectColumnRange(_ptAnchorCell.
X
, hti._col, true);
13887
SelectColumnRange(hti._col, _ptAnchorCell.
X
, true);
13898
if (hti._col != _ptCurrentCell.
X
)
13920
else if (_ptCurrentCell.
X
!= -1)
13924
_ptCurrentCell.
X
,
14185
if (_ptCurrentCell.
X
!= -1 && hti._col != _ptCurrentCell.
X
&& !CommitEditForOperation(hti._col, _ptCurrentCell.Y, true))
14267
if (_ptCurrentCell.
X
!= -1 && hti._col != _ptCurrentCell.
X
)
14495
&& dataGridViewColumn.Index == _ptCurrentCell.
X
14501
&& ColumnEditable(_ptCurrentCell.
X
)
14578
PositionEditingControl(_ptCurrentCell.
X
!= e.Column.Index, true, false);
14600
if (_ptMouseDownCell.
X
== -2
14602
&& _ptMouseDownCell.
X
== columnIndex
14604
&& (_ptMouseDownCell.
X
== -1
14606
|| (columnIndex == _ptCurrentCell.
X
&& rowIndex == _ptCurrentCell.Y))))
14781
else if (dataGridViewColumn.Visible && _ptCurrentCell.
X
== dataGridViewColumn.Index)
14802
if (_ptCurrentCell.
X
== dataGridViewColumn.Index
14902
if (_ptCurrentCell.
X
== dataGridViewCell.ColumnIndex
15019
if (Focused && EditMode == DataGridViewEditMode.EditOnEnter && _ptCurrentCell.
X
> -1 && !IsCurrentCellInEditMode)
15072
if (_ptCurrentCell.
X
> -1)
15080
_ptCurrentCell.
X
,
15084
if (_ptCurrentCell.
X
== -1)
15089
OnCellEnter(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15094
InvalidateCellPrivate(_ptCurrentCell.
X
, -1);
15103
if (_ptCurrentCell.
X
> -1 && !IsCurrentCellInEditMode)
15109
if (_ptCurrentCell.
X
> -1 && CurrentCellInternal.EditType is null && !_dataGridViewOper[OperationInMouseDown])
15114
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15123
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15246
if (_ptCurrentCell.
X
!= -1)
15248
InvalidateCell(_ptCurrentCell.
X
, _ptCurrentCell.Y);
15255
&& _ptCurrentCell.
X
> -1)
15288
if (_ptCurrentCell.
X
== -1)
15294
ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, forCurrentCellChange: false);
15334
if (newCurrentCell.
X
!= -1)
15336
Debug.Assert(_ptCurrentCell.
X
== -1);
15338
newCurrentCell.
X
,
15374
Debug.Assert(_ptCurrentCell.
X
== -1);
15376
newCurrentCell.
X
,
15414
Debug.Assert(_ptCurrentCell.
X
== -1);
15416
newCurrentCell.
X
,
15473
if (_ptCurrentCell.
X
!= -1)
15475
newCurrentCell = new Point(columnIndexInserted <= _ptCurrentCell.
X
? _ptCurrentCell.
X
+ 1 : _ptCurrentCell.
X
,
15595
newCurrentCell = new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y + insertionCount);
15678
newCurrentCell = new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y + dataGridViewRows.Length);
15741
if (_ptCurrentCell.
X
!= -1)
15800
if (_ptCurrentCell.
X
!= -1)
15834
if (_ptCurrentCell.
X
!= -1)
15877
if (_ptCurrentCell.
X
> -1 && !_dataGridViewState1[State1_LeavingWithTabKey])
15880
OnCellLeave(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15881
if (_ptCurrentCell.
X
== -1)
15886
OnRowLeave(ref dataGridViewCell, _ptCurrentCell.
X
, _ptCurrentCell.Y);
15894
if (_ptCurrentCell.
X
> -1 && _ptCurrentCell.Y > -1)
15896
InvalidateCellPrivate(columnIndex: _ptCurrentCell.
X
, rowIndex: _ptCurrentCell.Y);
15910
if (_ptCurrentCell.
X
!= -1)
15912
InvalidateCell(_ptCurrentCell.
X
, _ptCurrentCell.Y);
15935
if (_ptMouseDownCell.
X
== hti._col
15938
|| _ptMouseDownCell.
X
== -1
15940
|| (_ptMouseDownCell.
X
== _ptCurrentCell.
X
&& _ptMouseDownCell.Y == _ptCurrentCell.Y)))
16024
if (_ptMouseDownCell.
X
== hti._col && _ptMouseDownCell.Y == hti._row)
16167
if (_ptMouseDownCell.
X
!= -2)
16222
if (!mouseOverEditingPanel && !mouseOverEditingControl && !mouseOverToolTipControl && _ptMouseEnteredCell.
X
!= -2)
16224
if (_ptMouseEnteredCell.
X
>= -1 && _ptMouseEnteredCell.
X
< Columns.Count
16227
OnCellMouseLeave(new(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y));
16435
&& _ptMouseDownCell.
X
== hti._col
16569
if (_ptCurrentCell.
X
>= 0 && !CommitEdit(
16612
if (_ptCurrentCell.
X
>= 0 && !CommitEdit(
16921
&& _ptCurrentCell.
X
!= -1
16922
&& ColumnEditable(_ptCurrentCell.
X
)
16926
&& !Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
].ReadOnly) // Un-shares the row
16959
if (newCurrentCell.
X
!= -1)
16961
Debug.Assert(_ptCurrentCell.
X
== -1);
16963
newCurrentCell.
X
,
17012
Debug.Assert(_ptCurrentCell.
X
== -1);
17014
newCurrentCell.
X
,
17094
if (_ptCurrentCell.
X
!= -1)
17096
int newX = _ptCurrentCell.
X
;
17097
if (columnIndex == _ptCurrentCell.
X
)
17124
else if (columnIndex < _ptCurrentCell.
X
)
17126
newX = _ptCurrentCell.
X
- 1;
17130
if (columnIndex == _ptCurrentCell.
X
)
17344
newCurrentCell = new Point(_ptCurrentCell.
X
, newY);
17453
if (_ptCurrentCellCache.
X
!= -1)
17455
if (!IsInnerCellOutOfBounds(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y))
17457
SetCurrentCellAddressCore(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y, false, false, false);
17467
if (_ptCurrentCell.
X
== dataGridViewRow.Index && _ptCurrentCell.Y == columnIndex)
17471
_ptCurrentCellCache.X = _ptCurrentCell.
X
;
17612
&& _ptCurrentCell.
X
== -1
18015
int oldCurrentCellX = _ptCurrentCell.
X
;
18076
if (_ptCurrentCell.
X
== -1 && lastVisibleRowIndex != -1)
18209
_ptCurrentCell.
X
,
18469
&& !CommitEditForOperation(_ptCurrentCell.
X
, hti._row, forCurrentCellChange: true))
18553
bool success = SetCurrentCellAddressCore(_ptCurrentCell.
X
,
18749
&& !Columns[_ptCurrentCell.
X
].ReadOnly
18750
&& ColumnEditable(_ptCurrentCell.
X
)
18763
if (_ptCurrentCell.
X
!= -1 && dataGridViewRow.Index == _ptCurrentCell.Y && EditingControl is not null)
18875
if (pt.
X
< 0 && step < 0)
18877
Invalidate(new Rectangle(new Point(-pt.
X
, ColumnHeadersHeight), new Size(-step, ClientSize.Height)));
18885
if (pt.
X
> rect.Right && step > 0)
18887
Invalidate(new Rectangle(new Point(ClientSize.Width - (pt.
X
- rect.Right) - step, ColumnHeadersHeight),
19044
if (_ptCurrentCell.
X
!= -1)
19048
_ptCurrentCell.
X
,
19127
if (_ptCurrentCell.
X
>= 0)
19130
if (OnRowValidating(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y))
19137
if (_ptCurrentCell.
X
== -1)
19142
OnRowValidated(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y);
19145
if (DataSource is not null && _ptCurrentCell.
X
>= 0 && AllowUserToAddRowsInternal && NewRowIndex == _ptCurrentCell.Y)
19152
_ptCurrentCell.
X
,
19879
int leftEdge = GetColumnXFromIndex(_ptCurrentCell.
X
);
19882
leftEdge -= Columns[_ptCurrentCell.
X
].Width - 1;
19886
Columns[_ptCurrentCell.
X
].Width, Rows.SharedRow(_ptCurrentCell.Y).GetHeight(_ptCurrentCell.Y));
19889
if (!Columns[_ptCurrentCell.
X
].Frozen)
19925
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex == _ptCurrentCell.
X
;
20137
if (_ptCurrentCell.
X
> -1
20240
if (_ptCurrentCell.
X
== -1)
20266
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20272
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20274
if (_ptCurrentCell.
X
== -1 || _ptAnchorCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20281
_ptAnchorCell.
X
,
20287
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20295
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20300
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20307
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20308
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20318
if (_ptCurrentCell.
X
== -1)
20338
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20343
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20350
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20351
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20363
if (_ptCurrentCell.
X
== -1)
20389
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20394
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20402
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20404
if (_ptAnchorCell.
X
== -1)
20411
_ptAnchorCell.
X
,
20421
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20424
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20433
if (_ptCurrentCell.
X
== -1)
20459
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, forCurrentCellChange: true))
20464
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20471
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20473
_ptCurrentCell.
X
,
20493
if (_ptCurrentCell.
X
== -1)
20515
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20520
if (_ptAnchorCell.Y == -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20529
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20537
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20542
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20550
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20560
if (_ptCurrentCell.
X
== -1)
20580
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20585
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20593
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20605
if (_ptCurrentCell.
X
== -1)
20631
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20636
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20645
if (_ptAnchorCell.
X
== -1)
20665
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20674
if (_ptCurrentCell.
X
== -1)
20700
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20705
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20713
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
20729
if (_ptCurrentCell.
X
== -1)
20751
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20770
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20773
_ptAnchorCell.
X
,
20781
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, false, false, false);
20789
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20807
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
20808
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20811
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20821
if (_ptCurrentCell.
X
== -1)
20841
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
20860
SetSelectedCellCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true);
20863
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
20875
if (_ptCurrentCell.
X
== -1)
20901
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
20941
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
20943
if (_ptAnchorCell.
X
== -1)
20950
_ptAnchorCell.
X
,
20960
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
20964
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, !MultiSelect, false, false);
20973
if (_ptCurrentCell.
X
== -1)
20999
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
21018
SetSelectedCellCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true);
21021
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
21035
if (_ptCurrentCell.
X
== -1)
21055
if (!ScrollIntoView(_ptCurrentCell.
X
, lastVisibleRowIndex, true))
21060
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21066
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, lastVisibleRowIndex, true, false, false);
21075
if (_ptCurrentCell.
X
== -1)
21101
if (!ScrollIntoView(_ptCurrentCell.
X
, nextVisibleRowIndex, true))
21106
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21112
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextVisibleRowIndex, true, false, false);
21168
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21170
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21173
_ptAnchorCell.
X
,
21217
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21227
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21230
_ptAnchorCell.
X
,
21295
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21297
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
21334
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21339
if (_ptAnchorCell.
X
== -1)
21344
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
21351
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21353
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21355
if (_ptAnchorCell.
X
== -1)
21361
_ptAnchorCell.
X
,
21389
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21481
if (_ptCurrentCell.
X
!= -1)
21520
int columnIndex = _ptCurrentCell.
X
;
21563
if (_ptCurrentCell.
X
!= -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21569
|| !ColumnEditable(_ptCurrentCell.
X
));
21571
if (ColumnEditable(_ptCurrentCell.
X
)
21575
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, forCurrentCellChange: false);
21592
if (_ptCurrentCell.
X
!= -1)
21594
DataGridViewColumn dataGridViewColumn = Columns[_ptCurrentCell.
X
];
21642
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21644
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21647
_ptAnchorCell.
X
,
21691
if (MultiSelect && _ptAnchorCell.
X
>= 0)
21701
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21704
_ptAnchorCell.
X
,
21769
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21771
if (_ptAnchorCell.
X
== -1)
21776
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
21813
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21818
if (_ptAnchorCell.
X
== -1)
21823
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
21830
if (MultiSelect && _ptCurrentCell.
X
>= 0)
21832
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
21834
if (_ptAnchorCell.
X
== -1)
21840
_ptAnchorCell.
X
,
21868
if (_ptCurrentCell.
X
>= 0 && Columns[_ptCurrentCell.
X
].Selected)
21940
if (_ptCurrentCell.
X
!= -1)
21946
&& ColumnEditable(_ptCurrentCell.
X
)
21964
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
22075
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns && _ptCurrentCell.
X
!= -1)
22079
DataGridViewColumn dataGridViewColumn = Columns[_ptCurrentCell.
X
];
22084
BeginKeyboardColumnResize(_ptCurrentCell.
X
);
22111
if (CurrentCell is null || _ptCurrentCell.
X
== -1 || _ptCurrentCell.Y == -1)
22153
if (_ptCurrentCell.
X
!= -1)
22155
dataGridViewColumn = Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
],
22179
if (_ptCurrentCell.
X
== -1)
22212
Debug.Assert(_ptAnchorCell.
X
>= 0);
22213
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22215
if (_ptAnchorCell.
X
== -1)
22221
_ptAnchorCell.
X
,
22240
if (_ptCurrentCell.
X
== -1)
22290
if (_ptCurrentCell.
X
== -1)
22324
if (_ptAnchorCell.
X
== -1)
22329
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, previousVisibleColumnIndex))
22331
SelectColumnRange(_ptAnchorCell.
X
, previousVisibleColumnIndex, true);
22335
SelectColumnRange(previousVisibleColumnIndex, _ptAnchorCell.
X
, true);
22349
if (_ptCurrentCell.
X
== -1)
22399
if (_ptCurrentCell.
X
== -1)
22425
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22430
if (Columns[_ptCurrentCell.
X
].Selected)
22435
if (_ptAnchorCell.
X
== -1)
22440
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, previousVisibleColumnIndex))
22442
SelectColumnRange(_ptAnchorCell.
X
, previousVisibleColumnIndex, true);
22446
SelectColumnRange(previousVisibleColumnIndex, _ptAnchorCell.
X
, true);
22456
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22458
if (_ptAnchorCell.
X
== -1)
22464
_ptAnchorCell.
X
,
22484
if (_ptCurrentCell.
X
== -1)
22510
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22515
if (Columns[_ptCurrentCell.
X
].Selected)
22541
if (_ptCurrentCell.
X
== -1)
22603
if (_ptCurrentCell.
X
== -1)
22626
Debug.Assert(_ptAnchorCell.
X
>= 0);
22627
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22629
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22635
_ptAnchorCell.
X
,
22675
if (_ptCurrentCell.
X
== -1)
22723
if (_ptCurrentCell.
X
== -1)
22751
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22757
Debug.Assert(_ptAnchorCell.
X
>= 0);
22758
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
22769
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22774
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
22783
if (_ptCurrentCell.
X
== -1)
22821
if (_ptCurrentCell.
X
== -1)
22844
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22849
Debug.Assert(_ptAnchorCell.
X
>= 0);
22850
if (Columns[_ptCurrentCell.
X
].Selected)
22853
SelectColumnRange(firstVisibleColumnIndex, _ptAnchorCell.
X
, true);
22857
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
22860
_ptAnchorCell.
X
,
22878
if (_ptCurrentCell.
X
== -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
22883
if (Columns[_ptCurrentCell.
X
].Selected)
22885
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
22890
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
22901
if (_ptCurrentCell.
X
== -1)
22922
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22927
if (Columns[_ptCurrentCell.
X
].Selected)
22946
if (_ptCurrentCell.
X
== -1)
23020
if (!ScrollIntoView(_ptCurrentCell.
X
== -1 ? firstVisibleColumnIndex : _ptCurrentCell.
X
,
23058
if (_ptCurrentCell.
X
== -1)
23091
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23096
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23104
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23112
_ptAnchorCell.
X
,
23122
SetSelectedCellCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true);
23125
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, false, false, false);
23130
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23135
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23163
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, false, false, false);
23167
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23172
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23199
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23202
_ptAnchorCell.
X
,
23220
SetSelectedCellCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true);
23224
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23228
if (!ScrollIntoView(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true))
23233
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23238
success = SetCurrentCellAddressCore(_ptCurrentCell.
X
, nextScreenVisibleRowIndex, true, false, false);
23302
_ptCurrentCell.
X
== -1 ? firstVisibleColumnIndex : _ptCurrentCell.
X
,
23318
if (_ptCurrentCell.
X
== -1)
23350
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23355
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23363
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23365
if (_ptAnchorCell.
X
== -1)
23371
_ptAnchorCell.
X
,
23381
SetSelectedCellCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true);
23384
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, false, false, false);
23388
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23393
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23421
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, false, false, false);
23425
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23430
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23457
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23460
_ptAnchorCell.
X
,
23478
SetSelectedCellCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true);
23482
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23486
if (!ScrollIntoView(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true))
23491
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23496
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousScreenVisibleRowIndex, true, false, false);
23532
if (_ptCurrentCell.
X
!= -1)
23534
dataGridViewColumn = Columns.GetNextColumn(Columns[_ptCurrentCell.
X
],
23558
if (_ptCurrentCell.
X
== -1)
23591
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23593
if (_ptAnchorCell.
X
== -1)
23599
_ptAnchorCell.
X
,
23618
if (_ptCurrentCell.
X
== -1)
23668
if (_ptCurrentCell.
X
== -1)
23702
if (_ptAnchorCell.
X
== -1)
23707
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, nextVisibleColumnIndex))
23709
SelectColumnRange(_ptAnchorCell.
X
, nextVisibleColumnIndex, true);
23713
SelectColumnRange(nextVisibleColumnIndex, _ptAnchorCell.
X
, true);
23727
if (_ptCurrentCell.
X
== -1)
23777
if (_ptCurrentCell.
X
== -1)
23808
if (Columns[_ptCurrentCell.
X
].Selected)
23813
if (_ptAnchorCell.
X
== -1)
23818
if (Columns.DisplayInOrder(_ptAnchorCell.
X
, nextVisibleColumnIndex))
23820
SelectColumnRange(_ptAnchorCell.
X
, nextVisibleColumnIndex, true);
23824
SelectColumnRange(nextVisibleColumnIndex, _ptAnchorCell.
X
, true);
23836
if (_ptAnchorCell.
X
== -1)
23841
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
23844
_ptAnchorCell.
X
,
23864
if (_ptCurrentCell.
X
== -1)
23890
if (_ptCurrentCell.
X
== -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23895
if (Columns[_ptCurrentCell.
X
].Selected)
23921
if (_ptCurrentCell.
X
== -1)
23983
if (_ptCurrentCell.
X
== -1)
24011
Debug.Assert(_ptAnchorCell.
X
>= 0);
24012
if (_ptAnchorCell.
X
== -1)
24017
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24020
_ptAnchorCell.
X
,
24040
if (_ptCurrentCell.
X
== -1)
24078
if (_ptCurrentCell.
X
== -1)
24106
if (_ptAnchorCell.
X
== -1)
24112
Debug.Assert(_ptAnchorCell.
X
>= 0);
24113
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
24119
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
24128
if (_ptCurrentCell.
X
== -1)
24166
if (_ptCurrentCell.
X
== -1)
24194
Debug.Assert(_ptAnchorCell.
X
>= 0);
24195
if (_ptAnchorCell.
X
== -1)
24200
if (Columns[_ptCurrentCell.
X
].Selected)
24203
SelectColumnRange(_ptAnchorCell.
X
, lastVisibleColumnIndex, true);
24207
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24210
_ptAnchorCell.
X
,
24223
if (Columns[_ptCurrentCell.
X
].Selected)
24225
SetSelectedColumnCore(_ptCurrentCell.
X
, false);
24230
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
24241
if (_ptCurrentCell.
X
== -1)
24267
if (Columns[_ptCurrentCell.
X
].Selected)
24286
if (_ptCurrentCell.
X
== -1)
24329
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift && _ptCurrentCell.
X
!= -1)
24348
if (_selectedBandIndexes[bandIndex] != _ptCurrentCell.
X
)
24360
if (!Columns[_ptCurrentCell.
X
].Selected)
24362
Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.
X
));
24363
SetSelectedColumnCore(_ptCurrentCell.
X
, true);
24628
if (_ptCurrentCell.
X
== -1)
24644
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24649
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24655
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24658
_ptAnchorCell.
X
,
24664
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
24668
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24673
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24679
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
24680
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24686
if (_ptCurrentCell.
X
== -1)
24700
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24705
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24711
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
24712
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24720
if (_ptCurrentCell.
X
== -1)
24739
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24744
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24757
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
24760
_ptAnchorCell.
X
,
24770
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
24773
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
24778
if (_ptCurrentCell.
X
== -1)
24797
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24802
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24808
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, selected: true);
24810
_ptCurrentCell.
X
,
24826
if (_ptCurrentCell.
X
== -1)
24842
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24847
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24855
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
24859
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24864
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24871
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24877
if (_ptCurrentCell.
X
== -1)
24891
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
24896
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24903
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
24911
if (_ptCurrentCell.
X
== -1)
24930
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24935
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24962
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
24967
if (_ptCurrentCell.
X
== -1)
24986
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
24991
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24998
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
25010
if (_ptCurrentCell.
X
== -1)
25026
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
25031
if (_ptAnchorCell.
X
== -1 || _ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25044
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
25047
_ptAnchorCell.
X
,
25055
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, false, false, false);
25059
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
25064
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25076
SetSelectedCellCore(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
25077
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
25080
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25086
if (_ptCurrentCell.
X
== -1)
25100
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, true))
25105
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25118
SetSelectedCellCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true);
25121
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25129
if (_ptCurrentCell.
X
== -1)
25148
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25153
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25184
int oldEdgeColumnIndex = _ptCurrentCell.
X
;
25192
_ptAnchorCell.
X
,
25202
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
25206
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, !MultiSelect, false, false);
25211
if (_ptCurrentCell.
X
== -1)
25230
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25235
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25248
SetSelectedCellCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true);
25251
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
25261
if (_ptCurrentCell.
X
== -1)
25280
if (!ScrollIntoView(_ptCurrentCell.
X
, firstVisibleRowIndex, forCurrentCellChange: true))
25285
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25290
SetCurrentCellAddressCore(_ptCurrentCell.
X
, firstVisibleRowIndex, true, false, false);
25295
if (_ptCurrentCell.
X
== -1)
25314
if (!ScrollIntoView(_ptCurrentCell.
X
, previousVisibleRowIndex, true))
25319
if (_ptCurrentCell.
X
== -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25324
SetCurrentCellAddressCore(_ptCurrentCell.
X
, previousVisibleRowIndex, true, false, false);
25341
if (_ptCurrentCell.
X
!= -1 && !IsCurrentCellInEditMode && ColumnEditable(_ptCurrentCell.
X
))
25350
bool success = ScrollIntoView(_ptCurrentCell.
X
, _ptCurrentCell.Y, false);
25381
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
25423
_ptCurrentCell.
X
,
25436
dataGridViewCurrentCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
];
25461
dataGridViewCurrentCell = Rows[_ptCurrentCell.Y].Cells[_ptCurrentCell.
X
];
25543
if (_ptCurrentCell.
X
!= -1 && IsCurrentCellInEditMode)
26082
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26084
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26100
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26102
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26114
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26116
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26281
if (_ptCurrentCell.
X
>= 0 && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex))
26342
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26344
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26371
if (!committed && _ptCurrentCell.
X
>= 0 && !CommitEdit(
26373
forCurrentCellChange: forCurrentCellChange && (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex),
26856
if (_ptCurrentCell.
X
!= columnIndex || _ptCurrentCell.Y != rowIndex)
26876
int oldCurrentCellX = _ptCurrentCell.
X
;
26922
Debug.Assert(oldCurrentCellX == _ptCurrentCell.
X
);
27017
OnCellEnter(ref dataGridViewCellTmp, _ptCurrentCell.
X
, _ptCurrentCell.Y);
27032
InvalidateCellPrivate(_ptCurrentCell.
X
, _ptCurrentCell.Y);
27039
&& _ptCurrentCell.
X
!= -1
27057
if (_ptCurrentCell.
X
!= -1)
27059
AccessibilityNotifyCurrentCellChanged(new Point(_ptCurrentCell.
X
, _ptCurrentCell.Y));
27086
int oldCurrentCellX = _ptCurrentCell.
X
;
27128
Debug.Assert(oldCurrentCellX == _ptCurrentCell.
X
);
27153
if (_ptCurrentCell.
X
!= -1)
28293
_ptCurrentCellCache.X = _ptCurrentCell.
X
;
28361
if (_ptCurrentCellCache.
X
!= -1)
28363
if (!IsInnerCellOutOfBounds(_ptCurrentCellCache.
X
, _ptCurrentCellCache.Y))
28366
_ptCurrentCellCache.
X
,
28569
if (_ptCurrentCell.
X
!= -1)
28571
dataGridViewColumn = Columns.GetNextColumn(Columns[_ptCurrentCell.
X
],
28591
if (_ptCurrentCell.
X
== -1)
28619
if (_ptCurrentCell.
X
== -1)
28642
if (_ptCurrentCell.
X
== -1)
28665
if (_ptCurrentCell.
X
== -1)
28696
if (_ptCurrentCell.
X
== -1)
28730
if (_ptCurrentCell.
X
!= -1)
28732
dataGridViewColumn = Columns.GetPreviousColumn(Columns[_ptCurrentCell.
X
],
28760
if (_ptCurrentCell.
X
== -1)
28788
if (_ptCurrentCell.
X
== -1)
28811
if (_ptCurrentCell.
X
== -1)
28834
if (_ptCurrentCell.
X
== -1)
28865
if (_ptCurrentCell.
X
== -1)
29228
HitTestInfo htiToUse = hti ?? HitTest(ptMouse.
X
, ptMouse.Y);
29234
if (_ptMouseEnteredCell.
X
!= htiToUse._col || _ptMouseEnteredCell.Y != htiToUse._row)
29237
if (_ptMouseEnteredCell.
X
>= -1
29238
&& _ptMouseEnteredCell.
X
< Columns.Count
29242
dgvce = new DataGridViewCellEventArgs(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y);
29262
else if (_ptMouseEnteredCell.
X
!= -2)
29264
if (_ptMouseEnteredCell.
X
>= -1
29265
&& _ptMouseEnteredCell.
X
< Columns.Count
29269
DataGridViewCellEventArgs dgvce = new(_ptMouseEnteredCell.
X
, _ptMouseEnteredCell.Y);
29938
HitTestInfo hti = HitTest(ptMouse.
X
, ptMouse.Y);
29939
int mouseX = ptMouse.
X
, mouseY = ptMouse.Y;
29961
? HitTest(ptMouse.
X
- xOffset - (xOffset / Math.Abs(xOffset)), ptMouse.Y - yOffset - normOffset)
30045
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)
398
return ptCurrentCell.
X
!= -1 &&
399
ptCurrentCell.
X
== ColumnIndex &&
1489
if (ColumnIndex == ptCurrentCell.
X
&& rowIndex == ptCurrentCell.Y)
2710
if (ptCurrentCell.
X
!= -1 &&
2711
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
1303
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex &&
1442
&& DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (49)
809
DataGridView.MouseEnteredCellAddress.
X
== ColumnIndex)
1044
sortGlyphLocation.
X
+ line,
1046
sortGlyphLocation.
X
+ s_sortGlyphWidth - line - 1,
1051
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1053
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1065
sortGlyphLocation.
X
,
1067
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1070
sortGlyphLocation.
X
+ 1,
1072
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1075
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1077
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1080
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1082
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1085
sortGlyphLocation.
X
,
1087
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1094
sortGlyphLocation.
X
,
1096
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1099
sortGlyphLocation.
X
+ 1,
1101
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1104
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1106
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1109
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1111
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1114
sortGlyphLocation.
X
,
1116
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1131
sortGlyphLocation.
X
+ line,
1133
sortGlyphLocation.
X
+ s_sortGlyphWidth - line - 1,
1138
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1140
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1152
sortGlyphLocation.
X
,
1154
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1157
sortGlyphLocation.
X
+ 1,
1159
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1162
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1164
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1167
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1169
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1172
sortGlyphLocation.
X
,
1174
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1181
sortGlyphLocation.
X
,
1183
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1186
sortGlyphLocation.
X
+ 1,
1188
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2 - 1,
1191
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1193
sortGlyphLocation.
X
+ s_sortGlyphWidth - 2,
1196
sortGlyphLocation.
X
+ s_sortGlyphWidth / 2,
1198
sortGlyphLocation.
X
+ s_sortGlyphWidth - 3,
1201
sortGlyphLocation.
X
,
1203
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)
938
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\Labels\LinkLabel.cs (2)
310
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)
3219
return FindNearestItem(dir, point.
X
, point.Y);
3710
public ListViewHitTestInfo HitTest(Point point) => HitTest(point.
X
, point.Y);
4385
item = GetItemAt(pos.
X
, pos.Y);
6012
AccessibleObject? accessibilityObject = AccessibilityObject.HitTest(screenPoint.
X
, screenPoint.Y);
6734
OnMouseClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
6739
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)
1326
public HitTestInfo HitTest(Point point) => HitTest(point.
X
, point.Y);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
2449
OnMouseMove(new MouseEventArgs(e.Button, e.Clicks, newPoint.
X
, newPoint.Y, e.Delta));
2465
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)
480
return new Point(point.
X
+ (rect.Width / 2), point.Y + (rect.Height / 2));
642
return new Rectangle(pt.
X
, pt.Y, rect.Width, rect.Height);
701
g.TranslateTransform(newOrigin.
X
, newOrigin.Y);
702
r.Offset(-newOrigin.
X
, -newOrigin.Y);
1096
return _location.
X
+ GetEntryLabelIndent(gridEntry) + size.Width;
1107
return length > _location.
X
+ LabelWidth;
1134
clipRect.Offset(-newOrigin.
X
, -newOrigin.Y);
1189
clipRect.Offset(-newOrigin.
X
, -newOrigin.Y);
1454
Math.Max(rectScreen.X, location.
X
+ rect.X + rect.Width - size.Width));
1483
_dropDownHolder.SetBounds(location.
X
, location.Y, size.Width, size.Height);
1682
if (x < 0 || x > size.Width + _location.
X
)
1688
if (x > LabelWidth + _location.
X
)
1913
rect.X = _location.
X
;
1930
rect.X = _location.
X
+ LabelWidth;
2129
int startPS = _location.
X
;
2635
if (Math.Abs(screenPoint.
X
- _rowSelectPos.
X
) < SystemInformation.DoubleClickSize.Width &&
3069
if (point == InvalidPosition || (point.
X
!= RowLabel && point.
X
!= RowValue))
3077
onLabel = point.
X
== RowLabel;
3091
if ((rowMoveCurrent != TipRow || point.
X
!= TipColumn) && !_flags.HasFlag(Flags.IsSplitterMove))
3099
Rectangle itemRect = GetRectangle(point.Y, point.
X
);
3104
TipColumn = point.
X
;
3114
TipColumn = point.
X
;
3358
int lineEnd = location.
X
+ size.Width;
3359
int lineStart = location.
X
;
3841
int overhang = toolTip.Location.
X
+ toolTip.Size.Width - SystemInformation.VirtualScreen.Width;
4474
_labelWidth = _location.
X
+ (int)(size.Width / _labelRatio);
4492
_labelRatio = GetOurSize().Width / (double)(oldWidth - _location.
X
);
4873
if (_labelWidth > _location.
X
+ size.Width)
4875
_labelWidth = _location.
X
+ (int)(size.Width / _labelRatio);
4879
_labelRatio = GetOurSize().Width / (double)(_labelWidth - _location.
X
);
5292
mouseLoc = FindPosition(mouseLoc.
X
, mouseLoc.Y);
5307
Rectangle itemRect = GetRectangle(mouseLoc.Y, mouseLoc.
X
);
5311
if (mouseLoc.
X
== RowLabel)
5313
tipPt = curEntry.GetLabelToolTipLocation(mouseLoc.
X
- itemRect.X, mouseLoc.Y - itemRect.Y);
5315
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)
2245
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)
773
delta = x - _anchor.
X
;
957
int size = GetSplitSize(splitTarget, x - Left + _anchor.
X
, y - Top + _anchor.Y);
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
391
r.X -= p.
X
;
592
if (value.
X
< 0 || value.Y < 0)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (3)
2739
clientTopLeft.
X
,
2741
clientTopLeft.
X
+ clientRect.Width,
3151
clientTopLeft.
X
- windowRect.left,
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)
595
int deltaRightEdge = Math.Abs(rootHwndClientArea.right - gripLocation.
X
);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (8)
2163
int oppositeSide = otherItemMidLocation.
X
- midPointOfCurrent.
X
;
2605
if (location.
X
!= x || location.Y != y)
2625
if (location.
X
!= x || location.Y != y)
3330
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
3386
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
3430
mea = new MouseEventArgs(mea.Button, mea.Clicks, itemRelativePoint.
X
, itemRelativePoint.Y, mea.Delta);
4512
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)
3453
toPoint.X += currentToolStripItemLocation.
X
;
3465
fromPoint.X += currentToolStripItemLocation.
X
;
3480
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,
861
Rectangle bottomLeftParentVerticalPixels = new(bottomLeft.
X
, bottomLeft.Y - 1, 1, 2);
864
Rectangle bottomRightHorizontalPixels = new(bottomRight.
X
- 1, bottomRight.Y, 2, 1);
865
Rectangle bottomRightVerticalPixels = new(bottomRight.
X
, bottomRight.Y - 1, 1, 2);
872
topRightHorizontalPixels = new Rectangle(topRight.
X
- 1, topRight.Y, 1, 1);
873
topRightVerticalPixels = new Rectangle(topRight.
X
, topRight.Y, 1, 2);
877
topRightHorizontalPixels = new Rectangle(topRight.
X
- 2, topRight.Y, 2, 1);
878
topRightVerticalPixels = new Rectangle(topRight.
X
, topRight.Y, 1, 3);
1148
b.TranslateTransform(parent.Width - control.Location.
X
, parent.Height - control.Location.Y);
1306
g.FillRectangle(brush, top1.
X
, top1.Y, 1, 1);
1307
g.FillRectangle(brush, top2.
X
, top2.Y, 1, 1);
1395
Rectangle otherBottom = new(bottomLeft.
X
, bottomLeft.Y - 2, 1, 1);
1656
new(middle.
X
- Offset2X, middle.Y + 1),
1657
new(middle.
X
+ Offset2X + 1, middle.Y + 1),
1658
new(middle.
X
, middle.Y - Offset2Y)
1662
new(middle.
X
+ Offset2X, middle.Y - Offset2Y - 1),
1663
new(middle.
X
+ Offset2X, middle.Y + Offset2Y + 1),
1664
new(middle.
X
- 1, middle.Y)
1668
new(middle.
X
- Offset2X, middle.Y - Offset2Y - 1),
1669
new(middle.
X
- Offset2X, middle.Y + Offset2Y + 1),
1670
new(middle.
X
+ 1, middle.Y)
1674
new(middle.
X
- Offset2X, middle.Y - 1),
1675
new(middle.
X
+ Offset2X + 1, middle.Y - 1),
1676
new(middle.
X
, middle.Y + Offset2Y)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (12)
669
arrow[0] = new(middle.
X
- Offset2X, middle.Y + 1);
670
arrow[1] = new(middle.
X
+ Offset2X + 1, middle.Y + 1);
671
arrow[2] = new(middle.
X
, middle.Y - Offset2Y);
675
arrow[0] = new(middle.
X
+ Offset2X, middle.Y - s_offset4Y);
676
arrow[1] = new(middle.
X
+ Offset2X, middle.Y + s_offset4Y);
677
arrow[2] = new(middle.
X
- horizontalOffset, middle.Y);
681
arrow[0] = new(middle.
X
- Offset2X, middle.Y - s_offset4Y);
682
arrow[1] = new(middle.
X
- Offset2X, middle.Y + s_offset4Y);
683
arrow[2] = new(middle.
X
+ horizontalOffset, middle.Y);
687
arrow[0] = new(middle.
X
- Offset2X, middle.Y - 1);
688
arrow[1] = new(middle.
X
+ Offset2X + 1, middle.Y - 1);
689
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)
1630
public TreeViewHitTestInfo HitTest(Point pt) => HitTest(pt.
X
, pt.Y);
1671
public TreeNode? GetNodeAt(Point pt) => GetNodeAt(pt.
X
, pt.Y);
3056
OnNodeMouseClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), button, 1, pos.
X
, pos.Y));
3057
OnClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3058
OnMouseClick(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3086
OnMouseUp(new MouseEventArgs(button, 1, pos.
X
, pos.Y, 0));
3331
OnNodeMouseClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), _downButton, 1, point.
X
, point.Y));
3343
OnNodeMouseDoubleClick(new TreeNodeMouseClickEventArgs(NodeFromHandle(hnode), _downButton, 2, point.
X
, point.Y));
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
1246
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)
307
htmlWindow.Value->moveTo(point.
X
, point.Y).ThrowOnFailure();
413
htmlWindow.Value->scrollTo(point.
X
, point.Y).ThrowOnFailure();
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1367
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)
785
Bounds = new Rectangle(location.
X
, location.Y, extent.Width, extent.Height);
1131
sz.Width = phm.
X
;
System\Windows\Forms\Form.cs (5)
929
SetDesktopLocation(value.
X
, value.Y);
1366
Location.
X
,
3921
if (p.
X
< screenRect.X)
3925
else if (p.
X
+ s.Width > screenRect.X + screenRect.Width)
7078
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
;
1580
_splitterRect.X = ((RightToLeft == RightToLeft.Yes) ? Width - _splitterDistance - SplitterWidthInternal : Location.
X
+ _splitterDistance);
1587
_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)
649
offset.X -= Position.
X
;
652
int borderPixelsX = PhysicalToPixels(Border, _screenDPI.
X
);
685
int x = offset.
X
+ borderPixelsX * (column + 1) + lastImageSize.
X
;
776
new(PixelsToPhysical(pixels.Width, dpi.
X
), PixelsToPhysical(pixels.Height, dpi.Y));
782
new(PhysicalToPixels(physical.Width, dpi.
X
), PhysicalToPixels(physical.Height, dpi.Y));
788
_hScrollBar.Value = Math.Clamp(value.
X
, _hScrollBar.Minimum, _hScrollBar.Maximum);
943
pos = vertical ? locPos.Y : locPos.
X
;
976
pos = vertical ? locPos.Y : locPos.
X
;
1061
pos = locPos.
X
;
1079
pos = locPos.
X
;
System\Windows\Forms\Rendering\ControlPaint.cs (3)
460
transform.Translate(scrollOffset.
X
, scrollOffset.Y);
1863
PInvoke.MoveToEx(desktopDC, start.
X
, start.Y, lppt: null);
1864
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);
831
SetDisplayRectLocation(scrollLocation.
X
, scrollLocation.Y);
890
xCalc += activeControl.AutoScrollOffset.
X
;
1111
if (pt.
X
!= 0 || pt.Y != 0)
System\Windows\Forms\ToolTip\ToolTip.cs (13)
1324
if (cursorLocation.
X
< rect.left || cursorLocation.
X
> rect.right ||
1340
SetTrackPosition(p.
X
, p.Y);
1414
int pointX = r.left + point.
X
;
1434
int pointX = r.left + point.
X
;
1502
pointX = optimalPoint.
X
;
1931
if (moveToLocation.
X
+ tipSize.Width > screen.WorkingArea.Right)
1936
if (moveToLocation.
X
< screen.WorkingArea.Left)
1950
moveToLocation.
X
,
2010
if (cursorLocation.
X
>= r.left && cursorLocation.
X
<= r.right &&
2183
wp->x = cursorPos.
X
;
2203
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
,
733
Point newPosition = new(mouseLoc.
X
- _initialMouseLoc.
X
+ _dragComponents[_primaryComponentIndex].originalControlLocation.
X
,
738
Rectangle newRect = new(newPosition.
X
, newPosition.Y,
770
newPosition.X += _lastSnapOffset.
X
;
782
newPosition = new Point(mouseLoc.
X
- _initialMouseLoc.
X
+ _originalDragImageLocation.
X
,
784
newPosition.X += _lastSnapOffset.
X
;
800
invalidDragRegion.Translate(mouseLoc.
X
- _initialMouseLoc.
X
+ _lastSnapOffset.
X
, mouseLoc.Y - _initialMouseLoc.Y + _lastSnapOffset.Y);
942
_dragComponents[i].positionOffset = new Point(dragControl.Location.
X
- primaryControl.Location.
X
,
1027
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)
127
offset.X = _lastRectangle.Left - mouseLoc.
X
;
133
offset.X = _lastRectangle.Right - mouseLoc.
X
;
185
offset.X = _lastRectangle.Left - mouseLoc.
X
;
191
offset.X = _lastRectangle.Right - mouseLoc.
X
;
210
offset.X = _lastRectangle.Left - mouseLoc.
X
;
256
ToolboxSnapDragDropEventArgs se = CreateToolboxSnapArgs(e, new Point(e.X - screenOffset.
X
, e.Y - screenOffset.Y));
307
mouseLoc.
X
- DesignerUtils.s_boxImageSize / 2,
318
newRectangle.Offset(_lastOffset.
X
, _lastOffset.Y);
343
Rectangle statusRect = new(newRectangle.X - adornerServiceOrigin.
X
, newRectangle.Y - adornerServiceOrigin.Y, 0, 0);
System\Windows\Forms\Design\CommandSet.cs (43)
812
moveOffsetX = snappedOffset.
X
;
881
moveOffsetX = loc.
X
- primaryControl.Location.
X
;
1053
loc.X = primaryLocation.
X
+ primarySize.Width - size.Width;
1061
loc.X = primarySize.Width / 2 + primaryLocation.
X
- size.Width / 2;
1070
loc.X = primaryLocation.
X
;
1182
delta = loc.
X
% gridSize.Width;
1296
if (loc.
X
< left)
1297
left = loc.
X
;
1300
if (loc.
X
+ size.Width > right)
1301
right = loc.
X
+ size.Width;
2427
loc.X = (loc.
X
/ grid.Width) * grid.Width;
2697
? (lastSize.Width + lastLoc.
X
- curLoc.
X
- total) / (selectedObjects.Length - 1)
2794
curLoc.X = lastLoc.
X
+ lastSize.Width;
2801
if (curLoc.
X
< primaryLoc.
X
)
2802
curLoc.X = primaryLoc.
X
;
2807
if (curLoc.
X
> primaryLoc.
X
)
2808
curLoc.X = primaryLoc.
X
;
2824
curLoc.X = lastLoc.
X
+ lastSize.Width + nEqualDelta;
3246
if (min.
X
> loc.
X
)
3248
min.X = loc.
X
;
3256
if (max.
X
< loc.
X
+ size.Width)
3258
max.X = loc.
X
+ size.Width;
3273
Point offset = new(-min.
X
, -min.Y);
3287
parentOffset.X -= (max.
X
- min.
X
) / 2;
3369
groupEndX = parentOffset.
X
+ max.
X
- min.
X
;
3374
groupEndX = parentOffset.
X
+ gridSize.Width;
3399
offset.Offset(parentOffset.
X
, parentOffset.Y);
3412
newLoc.Offset(offset.
X
, offset.Y);
3469
return pLoc.
X
== qLoc.
X
? pLoc.Y - qLoc.Y : pLoc.
X
- qLoc.
X
;
3487
return pLoc.Y == qLoc.Y ? pLoc.
X
- qLoc.
X
: pLoc.Y - qLoc.Y;
System\Windows\Forms\Design\ComponentTray.cs (36)
598
SetTrayLocation(comp, new Point(tc.Location.
X
- _autoScrollPosBeforeDragging.
X
, tc.Location.Y - _autoScrollPosBeforeDragging.Y));
602
AutoScrollPosition = new Point(-_autoScrollPosBeforeDragging.
X
, -_autoScrollPosBeforeDragging.Y);
654
mcs.ShowContextMenu(MenuCommands.TraySelectionMenu, location.
X
, location.Y);
658
mcs.ShowContextMenu(MenuCommands.ComponentTrayMenu, location.
X
, location.Y);
979
return new Point(loc.
X
- autoScrollLoc.
X
, loc.Y - autoScrollLoc.Y);
1190
_mouseDragWorkspace.X = Math.Min(start.
X
, end.
X
);
1192
_mouseDragWorkspace.Width = Math.Abs(end.
X
- start.
X
);
1325
X = Math.Min(_mouseDragStart.
X
, e.X),
1327
Width = Math.Abs(e.X - _mouseDragStart.
X
),
1560
location = new Point(location.
X
+ autoScrollLoc.
X
, location.Y + autoScrollLoc.Y);
1604
if (location.
X
== -1 && location.Y == -1)
1810
_whiteSpace.X = _whiteSpace.
X
* 2 + 3;
1817
Point newLoc = new(display.X + _whiteSpace.
X
, display.Y + _whiteSpace.Y);
1829
newLoc = new Point(newLoc.
X
- autoScrollLoc.
X
, newLoc.Y - autoScrollLoc.Y);
1845
Point newLoc = new(bounds.X + bounds.Width + _whiteSpace.
X
, bounds.Y);
1848
if (newLoc.
X
+ c.Size.Width > Size.Width)
1850
newLoc.X = _whiteSpace.
X
;
1864
newLoc = new Point(newLoc.
X
- autoScrollLoc.
X
, newLoc.Y - autoScrollLoc.Y);
2178
(Math.Abs(_mouseDragLast.
X
- newPt.
X
) < minDrag.Width &&
2198
if (_tray._selectionUISvc is not null && _tray._selectionUISvc.BeginDrag(SelectionRules.Visible | SelectionRules.Moveable, _mouseDragLast.
X
, _mouseDragLast.Y))
2239
mcs.ShowContextMenu(MenuCommands.TraySelectionMenu, location.
X
, location.Y);
2521
if (location.
X
== -1 && location.Y == -1)
2535
pt.Offset(pt1.
X
, pt1.Y);
2538
pt.Offset(Location.
X
, Location.Y);
2757
if (tcLoc1.
X
== tcLoc2.
X
&& tcLoc1.Y == tcLoc2.Y)
2775
return ((tcLoc1.
X
<= tcLoc2.
X
) ? -1 : 1);
System\Windows\Forms\Design\ControlCommandSet.cs (7)
477
lines.Add(new SnapLine(SnapLineType.Right, pt.
X
+ primaryControl.Width - 1));
478
lines.Add(new SnapLine(SnapLineType.Vertical, pt.
X
+ primaryControl.Width + primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always));
485
lines.Add(new SnapLine(SnapLineType.Left, pt.
X
));
486
lines.Add(new SnapLine(SnapLineType.Vertical, pt.
X
- primaryControl.Margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
641
primaryControlsize += new Size(snappedOffset.
X
, snappedOffset.Y);
652
moveOffsetX = snappedOffset.
X
;
714
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
,
1817
Point location = new(baseVar.
X
, baseVar.Y);
1819
_statusCommandUI?.SetStatusInformation(new Rectangle(location.
X
, location.Y, offset.Width, offset.Height));
1914
_mouseDragOffset.X = _mouseDragBase.
X
;
1916
_mouseDragOffset.Width = x - _mouseDragBase.
X
;
1932
Rectangle r = new(_mouseDragBase.
X
- _adornerWindowToScreenOffset.
X
,
1934
x - _mouseDragBase.
X
, y - _mouseDragBase.Y);
1936
_mouseDragOffset.Width += offset.
X
;
1969
Rectangle frameRect = new(_mouseDragOffset.X - _adornerWindowToScreenOffset.
X
,
1983
oldFrameRect.X -= _adornerWindowToScreenOffset.
X
;
2010
_statusCommandUI?.SetStatusInformation(new Rectangle(offset.
X
, offset.Y, _mouseDragOffset.Width, _mouseDragOffset.Height));
2185
newLoc = new Point(controlLoc.
X
- parentLoc.
X
, controlLoc.Y - parentLoc.Y);
2190
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)
521
if (((ISelectionUIService)this).BeginDrag(rules, anchor.
X
, anchor.Y))
565
if (((ISelectionUIService)this).BeginDrag(rules, anchor.
X
, anchor.Y))
625
Math.Abs(screenCoord.
X
- _mouseDragAnchor.
X
) < minDragSize.Width &&
633
if (((ISelectionUIService)this).BeginDrag(_dragRules, _mouseDragAnchor.
X
, _mouseDragAnchor.Y))
649
_mouseDragOffset.X = screenCoord.
X
- _mouseDragAnchor.
X
;
661
_mouseDragOffset.X = screenCoord.
X
- _mouseDragAnchor.
X
;
662
_mouseDragOffset.Width = _mouseDragAnchor.
X
- screenCoord.
X
;
666
_mouseDragOffset.Width = screenCoord.
X
- _mouseDragAnchor.
X
;
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (20)
244
if (pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X)
269
Debug.Assert(!(pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X), "Should be handled by left top check");
270
if (pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width)
275
if (pt.
X
>= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2
276
&& pt.
X
<= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2)
284
if (pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width)
305
Debug.Assert(!(pt.
X
>= _outerRect.X && pt.
X
<= _innerRect.X), "Should be handled by left bottom check");
307
Debug.Assert(!(pt.
X
>= _innerRect.X + _innerRect.Width && pt.
X
<= _outerRect.X + _outerRect.Width), "Should be handled by right bottom check");
309
if (pt.
X
>= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2 && pt.
X
<= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2)
384
if (pt.
X
< _outerRect.X || pt.
X
> _outerRect.X + _outerRect.Width)
394
if (pt.
X
> _innerRect.X
395
&& 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)
610
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));
974
if (pos.
X
<= bounds.X)
978
else if (pos.
X
< bounds.Right)
986
if (pos.
X
>= offset - columns[i])
997
if (pos.
X
>= bounds.Right)
1001
else if (pos.
X
> bounds.X)
1007
if (pos.
X
<= offset + columns[i])
1264
if (dropPoint.Y < 0 || dropPoint.Y >= rows.Length || dropPoint.
X
< 0 || dropPoint.
X
>= columns.Length)
1271
Control existingControl = ((TableLayoutPanel)Control).GetControlFromPosition(dropPoint.
X
, dropPoint.Y);
1292
_curCol = cell.
X
;
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1830
if (offset.
X
>= parentToolStrip.Items[0].Bounds.X)
1835
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))
979
parentDesigner.DragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.
X
- (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
1002
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)
489
x = p.
X
;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
1343
dropDownItem.DropDown.Location = new Point(dropDownItem.DropDown.Location.
X
+ _commitedEditorNode.Bounds.Width - dropDownItem.Bounds.Width, dropDownItem.DropDown.Location.Y);
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 };