System\Windows\Forms\Control.cs (30)
755[DefaultValue(typeof(Point), "0, 0")]
756public virtual Point AutoScrollOffset
758get => Properties.GetValueOrDefault(s_autoScrollOffsetProperty, Point.Empty);
759set => Properties.AddOrRemoveValue(s_autoScrollOffsetProperty, value, defaultValue: Point.Empty);
1769PInvoke.GetCursorPos(out Point p);
2694public Point Location
2851public static Point MousePosition
2855PInvoke.GetCursorPos(out Point pt);
5094/// <inheritdoc cref="DoDragDropAsJson{T}(T, DragDropEffects, Bitmap?, Point, bool)"/>
5122Point cursorOffset,
5166/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
5177Point cursorOffset,
5531public Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue)
5555public Control? GetChildAtPoint(Point pt) => GetChildAtPoint(pt, GetChildAtPointSkip.None);
8671Point offs = Location;
8939PaintBackground(e, rectangle, BackColor, Point.Empty);
8941internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8965Point scrollLocation = scrollOffset;
8966if (this is ScrollableControl scrollControl && scrollLocation != Point.Empty)
9369public Point PointToClient(Point p)
9378public Point PointToScreen(Point p)
9586Point viewportOrg = default;
9604PrintToMetaFileRecursive(hDC, lParam, new Rectangle(Point.Empty, Size));
9619Point clientOffset = PointToScreen(Point.Empty);
12001Point client;
12455Point location = PARAM.ToPoint(m.LParamInternal);
12456Point screenLocation = PointToScreen(location);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (17)
189Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
190Point p2 = new(bounds.X, bounds.Y); // Upper left
191Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
192Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
244Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
245Point p2 = new(bounds.X, bounds.Y); // Upper left
246Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
247Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
292Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
293Point p2 = new(bounds.X, bounds.Y); // Upper left
294Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
295Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
350Point p1 = new(r.Right - 1, r.Top); // Upper inner right
351Point p2 = new(r.Left, r.Top); // Upper left
352Point p3 = new(r.Left, r.Bottom - 1); // Bottom inner left
353Point p4 = new(r.Right - 1, r.Bottom - 1); // Inner bottom right
426internal virtual void DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (11)
49/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
50public static void DrawCheckBox(Graphics g, Point glyphLocation, CheckBoxState state)
72Point glyphLocation,
83/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
86Point glyphLocation,
101/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
104Point glyphLocation,
114Point glyphLocation,
155/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
158Point glyphLocation,
182Point glyphLocation,
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (13)
49/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
50public static void DrawRadioButton(Graphics g, Point glyphLocation, RadioButtonState state) =>
55Point glyphLocation,
66Point glyphLocation,
87/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
90Point glyphLocation,
102/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
105Point glyphLocation,
118Point glyphLocation,
155/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
158Point glyphLocation,
182Point glyphLocation,
205Point glyphLocation,
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (23)
65protected virtual void AccessibilityNotifyCurrentCellChanged(Point cellAddress)
4966private Point ConvertCellToGridCoord(int columnIndex, int rowIndex, int x, int y)
6076Point ptMouse = PointToClient(MousePosition);
9688Point ptMouse = PointToClient(MousePosition);
10445Point firstDisplayedCellAddress = FirstDisplayedCellAddress;
11956Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
12126Point ptOriginalCurrentCell = _ptCurrentCell;
12739Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
15331internal void OnInsertedColumn_PostNotification(Point newCurrentCell)
15364internal void OnInsertedRow_PostNotification(int rowIndex, Point newCurrentCell, bool lastInsertion)
15403internal void OnInsertedRows_PostNotification(DataGridViewRow[] dataGridViewRows, Point newCurrentCell)
15427internal void OnInsertingColumn(int columnIndexInserted, DataGridViewColumn dataGridViewColumn, out Point newCurrentCell)
15585ref Point newCurrentCell,
15671internal void OnInsertingRows(int rowIndexInserted, DataGridViewRow[] dataGridViewRows, ref Point newCurrentCell)
16956internal void OnRemovedColumn_PostNotification(DataGridViewColumn dataGridViewColumn, Point newCurrentCell)
17007internal void OnRemovedRow_PostNotification(DataGridViewRow dataGridViewRow, Point newCurrentCell)
17085internal void OnRemovingColumn(DataGridViewColumn dataGridViewColumn, out Point newCurrentCell, bool force)
17298internal void OnRemovingRow(int rowIndexDeleted, out Point newCurrentCell, bool force)
18871Point pt = PointToScreen(Location);
26064Point ptMouse = PointToClient(MousePosition);
29227Point ptMouse = PointToClient(MousePosition);
29937Point ptMouse = PointToClient(MousePosition);
30032Point client;
System\Windows\Forms\Controls\GroupBox\GroupBox.Modern.cs (1)
277Point.Empty,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (29)
24private static Point InvalidPoint { get; } = new(int.MinValue, int.MinValue);
54private static Point InvalidPosition { get; } = new(int.MinValue, int.MinValue);
92private Point _location = new(1, 1);
97private Point _rowSelectPos = Point.Empty; // the position that we clicked on a row to test for double clicks
98private Point _lastMouseDown = InvalidPosition;
473public Point ContextMenuDefaultLocation
479Point point = PointToScreen(new(rect.X, rect.Y));
625Point pt = new(rect.X, rect.Y);
698private static void AdjustOrigin(Graphics g, Point newOrigin, ref Rectangle r)
1125Point newOrigin = new(rect.X, rect.Y);
1180Point newOrigin = new(rect.X, rect.Y);
1448Point location = PointToScreen(new Point(0, 0));
1673private Point FindPosition(int x, int y)
1687Point pt = new(RowLabel, 0);
2633Point screenPoint = EditTextBox.PointToScreen(e.Location);
2643_rowSelectPos = Point.Empty;
3012Point pos = FindPosition(e.X, e.Y);
3058Point point;
3321Point startPosition = FindPosition(clipRect.X, clipRect.Y);
3322Point endPosition = FindPosition(clipRect.X, clipRect.Y + clipRect.Height);
3338Point location = _location;
3488Point editPoint = PointToScreen(_lastMouseDown);
3502_rowSelectPos = Point.Empty;
3836Point location = parent.PointToScreen(new(rect.left, rect.top));
4908Point location = topControl.Location;
5290Point mouseLoc = Cursor.Position;
5308Point tipPt = Point.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (23)
32internal static Point s_invalidMouseEnter = new(int.MaxValue, int.MaxValue);
74private Point _mouseEnterWhenShown = s_invalidMouseEnter;
256public new Point AutoScrollPosition
2138Point midPointOfCurrent = new(selectedItem.Bounds.X + selectedItem.Width / 2,
2162Point otherItemMidLocation = new(otherItem.Bounds.X + otherItem.Width / 2, (down) ? otherItem.Bounds.Top : otherItem.Bounds.Bottom);
2598Point location = Location;
3329Point itemRelativePoint = item.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3385Point itemRelativePoint = item!.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3429Point itemRelativePoint = item.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3792g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3799g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3806g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3819g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3826g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3833g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3856public new Control? GetChildAtPoint(Point point) => base.GetChildAtPoint(point);
3859public new Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue) => base.GetChildAtPoint(pt, skipValue);
3876public ToolStripItem? GetItemAt(Point point)
4055Point newLocation = item.Bounds.Location;
4066protected internal void SetItemLocation(ToolStripItem item, Point location)
4124Point mousePosition = WindowsFormsUtils.LastCursorPoint;
4510Point cursorLocation = Cursor.Position;
4636Point pt = PointToClient(WindowsFormsUtils.LastCursorPoint);
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (8)
135Rectangle bounds = new(Point.Empty, e.Item.Size);
187Rectangle bounds = new(Point.Empty, menuItem.Size);
208DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down));
258Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
287Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
350Rectangle bounds = new(Point.Empty, e.Item.Size);
410Rectangle bounds = new(Point.Empty, e.Item.Size);
442Rectangle bounds = new(Point.Empty, e.Item.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (9)
561client.Location = Point.Empty;
2158/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
2165public unsafe DragDropEffects DoDragDrop(object data, DragDropEffects allowedEffects, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2224internal IDropSource.Interface CreateDropSource(IComVisibleDataObject dataObject, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2377Point rectangleLocation = TranslatePoint(r.Location, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ToolStripCoords);
3423internal Point TranslatePoint(Point fromPoint, ToolStripPointType fromPointType, ToolStripPointType toPointType)
3440Point toPoint;
3441Point currentToolStripItemLocation = Bounds.Location;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (37)
186Point middle = RenderArrowInternal(g, overflowArrowRect, direction, SystemBrushes.ControlText);
230Rectangle bounds = new(Point.Empty, item.Size);
248RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical);
266Rectangle bounds = new(Point.Empty, item.Size);
346Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty);
416Rectangle bounds = new(Point.Empty, toolStrip.Size);
545Rectangle bounds = new(Point.Empty, item.Size);
768e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel);
845Rectangle bounds = new(Point.Empty, toolStrip.Size);
852Point topLeft = Point.Empty;
853Point topRight = new(bounds.Width - 1, 0);
854Point bottomLeft = new(0, bounds.Height - 1);
855Point bottomRight = new(bounds.Width - 1, bounds.Height - 1);
1107Rectangle bounds = new(Point.Empty, item.Size);
1133g.FillRectangle(brush, new Rectangle(Point.Empty, control.Size));
1140Rectangle gradientBounds = new(Point.Empty, parent.Size);
1149g.FillRectangle(b, new Rectangle(Point.Empty, control.Size));
1154Rectangle gradientBounds = new(Point.Empty, control.Size);
1173Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1182Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1194Rectangle bounds = new(Point.Empty, toolStripDropDown.Size);
1216Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size);
1269Point start = new(overflowBoundsFill.Left - 1, overflowBoundsFill.Height - 2);
1270Point end = new(overflowBoundsFill.Left, overflowBoundsFill.Height - 2);
1297Point top1 = new(overflowBoundsFill.X - 2, 0);
1298Point top2 = new(overflowBoundsFill.X - 1, 1);
1337Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1343Point topLeft = Point.Empty;
1344Point topRight = new(bounds.Width - 1, 0);
1345Point bottomLeft = new(0, bounds.Height - 1);
1387Point gradientCopyPixel = bottomLeft;
1566Rectangle bounds = new(Point.Empty, item.Size);
1645private static Point RenderArrowInternal(Graphics g, Rectangle dropDownRect, ArrowDirection direction, Brush brush)
1647Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2);
1652Point[] arrow = direction switch
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (9)
331Rectangle bounds = new(Point.Empty, e.GripBounds.Size);
441vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
447DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down));
474Rectangle bounds = new(Point.Empty, item.Size);
497Rectangle fillRect = new(Point.Empty, item.Size);
543RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical);
655Rectangle bounds = new(Point.Empty, splitButton.Size);
715vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
727RenderSmall3DBorderInternal(g, new Rectangle(Point.Empty, item.Size), state, (item.RightToLeft == RightToLeft.Yes));
System\Windows\Forms\Rendering\TextRenderer.cs (14)
25public static void DrawText(IDeviceContext dc, string? text, Font? font, Point pt, Color foreColor)
34/// <param name="pt">The <see cref="Point"/> that represents the upper-left corner of the drawn text.</param>
37public static void DrawText(IDeviceContext dc, ReadOnlySpan<char> text, Font font, Point pt, Color foreColor)
44Point pt,
55/// <param name="pt">The <see cref="Point"/> that represents the upper-left corner of the drawn text.</param>
63Point pt,
72Point pt,
84/// <param name="pt">The <see cref="Point"/> that represents the upper-left corner of the drawn text.</param>
95Point pt,
111Point pt,
124/// <param name="pt">The <see cref="Point"/> that represents the upper-left corner of the drawn text.</param>
136Point pt,
283Point pt,
396/// versions of <see cref="DrawText(IDeviceContext, ReadOnlySpan{char}, Font, Point, Color)"/> and
System\Windows\Forms\ToolTip\ToolTip.cs (18)
1032private HWND GetWindowFromPoint(Point screenCoords, ref bool success)
1059Point pt = screenCoords;
1318Point cursorLocation = Cursor.Position;
1319Point p = cursorLocation;
1406public void Show(string? text, IWin32Window window, Point point)
1425public void Show(string? text, IWin32Window window, Point point, int duration)
1499Point optimalPoint = GetOptimalToolTipPosition(tool, toolRectangle, bubbleSize.Width, bubbleSize.Height);
1551private Point GetOptimalToolTipPosition(IKeyboardToolTip tool, Rectangle toolRectangle, int width, int height)
1791private void SetTool(IWin32Window window, string? text, TipInfo.Type type, Point position)
1925private void Reposition(Point tipPosition, Size tipSize)
1927Point moveToLocation = tipPosition;
1988if (tipInfo.Position != Point.Empty)
2006Point cursorLocation = Cursor.Position;
2022var lpPoint = (Point*)(nint)message.LParamInternal;
2145Point cursorPos = Cursor.Position;
2178if (((tipInfo.TipType & TipInfo.Type.SemiAbsolute) != 0) && tipInfo.Position == Point.Empty)
2200else if ((tipInfo.TipType & TipInfo.Type.SemiAbsolute) != 0 && tipInfo.Position != Point.Empty)
2262tipInfo.Position = Point.Empty;
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (5)
613public Point GetPoint(PointProperty prop)
618_lastHResult = PInvoke.GetThemePosition(HTHEME, Part, State, (THEME_PROPERTY_SYMBOL_ID)prop, out Point point);
716public HitTestCode HitTestBackground(IDeviceContext dc, Rectangle backgroundRectangle, Point pt, HitTestOptions options)
738public HitTestCode HitTestBackground(Graphics g, Rectangle backgroundRectangle, Region region, Point pt, HitTestOptions options)
750public HitTestCode HitTestBackground(IDeviceContext dc, Rectangle backgroundRectangle, IntPtr hRgn, Point pt, HitTestOptions options)