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