System\Windows\Forms\Control.cs (30)
745[DefaultValue(typeof(Point), "0, 0")]
746public virtual Point AutoScrollOffset
748get => Properties.GetValueOrDefault(s_autoScrollOffsetProperty, Point.Empty);
749set => Properties.AddOrRemoveValue(s_autoScrollOffsetProperty, value, defaultValue: Point.Empty);
1588PInvoke.GetCursorPos(out Point p);
2513public Point Location
2670public static Point MousePosition
2674PInvoke.GetCursorPos(out Point pt);
4877/// <inheritdoc cref="DoDragDropAsJson{T}(T, DragDropEffects, Bitmap?, Point, bool)"/>
4905Point cursorOffset,
4949/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
4960Point cursorOffset,
5306public Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue)
5330public Control? GetChildAtPoint(Point pt) => GetChildAtPoint(pt, GetChildAtPointSkip.None);
8008Point offs = Location;
8155PaintBackground(e, rectangle, BackColor, Point.Empty);
8157internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8181Point scrollLocation = scrollOffset;
8182if (this is ScrollableControl scrollControl && scrollLocation != Point.Empty)
8585public Point PointToClient(Point p)
8594public Point PointToScreen(Point p)
8802Point viewportOrg = default;
8820PrintToMetaFileRecursive(hDC, lParam, new Rectangle(Point.Empty, Size));
8835Point clientOffset = PointToScreen(Point.Empty);
11217Point client;
11667Point location = PARAM.ToPoint(m.LParamInternal);
11668Point screenLocation = PointToScreen(location);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (17)
139Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
140Point p2 = new(bounds.X, bounds.Y); // Upper left
141Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
142Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
194Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
195Point p2 = new(bounds.X, bounds.Y); // Upper left
196Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
197Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
242Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
243Point p2 = new(bounds.X, bounds.Y); // Upper left
244Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
245Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
300Point p1 = new(r.Right - 1, r.Top); // Upper inner right
301Point p2 = new(r.Left, r.Top); // Upper left
302Point p3 = new(r.Left, r.Bottom - 1); // Bottom inner left
303Point p4 = new(r.Right - 1, r.Bottom - 1); // Inner bottom right
376internal 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)
20protected virtual void AccessibilityNotifyCurrentCellChanged(Point cellAddress)
4907private Point ConvertCellToGridCoord(int columnIndex, int rowIndex, int x, int y)
6017Point ptMouse = PointToClient(MousePosition);
9629Point ptMouse = PointToClient(MousePosition);
10386Point firstDisplayedCellAddress = FirstDisplayedCellAddress;
11897Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
12067Point ptOriginalCurrentCell = _ptCurrentCell;
12680Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
15266internal void OnInsertedColumn_PostNotification(Point newCurrentCell)
15299internal void OnInsertedRow_PostNotification(int rowIndex, Point newCurrentCell, bool lastInsertion)
15338internal void OnInsertedRows_PostNotification(DataGridViewRow[] dataGridViewRows, Point newCurrentCell)
15362internal void OnInsertingColumn(int columnIndexInserted, DataGridViewColumn dataGridViewColumn, out Point newCurrentCell)
15520ref Point newCurrentCell,
15606internal void OnInsertingRows(int rowIndexInserted, DataGridViewRow[] dataGridViewRows, ref Point newCurrentCell)
16891internal void OnRemovedColumn_PostNotification(DataGridViewColumn dataGridViewColumn, Point newCurrentCell)
16942internal void OnRemovedRow_PostNotification(DataGridViewRow dataGridViewRow, Point newCurrentCell)
17020internal void OnRemovingColumn(DataGridViewColumn dataGridViewColumn, out Point newCurrentCell, bool force)
17233internal void OnRemovingRow(int rowIndexDeleted, out Point newCurrentCell, bool force)
18806Point pt = PointToScreen(Location);
25991Point ptMouse = PointToClient(MousePosition);
29154Point ptMouse = PointToClient(MousePosition);
29864Point ptMouse = PointToClient(MousePosition);
29959Point client;
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);
1442Point location = PointToScreen(new Point(0, 0));
1667private Point FindPosition(int x, int y)
1681Point pt = new(RowLabel, 0);
2627Point screenPoint = EditTextBox.PointToScreen(e.Location);
2637_rowSelectPos = Point.Empty;
3006Point pos = FindPosition(e.X, e.Y);
3052Point point;
3309Point startPosition = FindPosition(clipRect.X, clipRect.Y);
3310Point endPosition = FindPosition(clipRect.X, clipRect.Y + clipRect.Height);
3326Point location = _location;
3476Point editPoint = PointToScreen(_lastMouseDown);
3490_rowSelectPos = Point.Empty;
3824Point location = parent.PointToScreen(new(rect.left, rect.top));
4896Point location = topControl.Location;
5278Point mouseLoc = Cursor.Position;
5296Point tipPt = Point.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (23)
27internal static Point s_invalidMouseEnter = new(int.MaxValue, int.MaxValue);
69private Point _mouseEnterWhenShown = s_invalidMouseEnter;
251public new Point AutoScrollPosition
2139Point midPointOfCurrent = new(selectedItem.Bounds.X + selectedItem.Width / 2,
2163Point otherItemMidLocation = new(otherItem.Bounds.X + otherItem.Width / 2, (down) ? otherItem.Bounds.Top : otherItem.Bounds.Bottom);
2599Point location = Location;
3330Point itemRelativePoint = item.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3386Point itemRelativePoint = item!.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3430Point itemRelativePoint = item.TranslatePoint(new Point(mea.X, mea.Y), ToolStripPointType.ToolStripCoords, ToolStripPointType.ToolStripItemCoords);
3793g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3800g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3807g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3820g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3827g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3834g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3857public new Control? GetChildAtPoint(Point point) => base.GetChildAtPoint(point);
3860public new Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue) => base.GetChildAtPoint(pt, skipValue);
3877public ToolStripItem? GetItemAt(Point point)
4056Point newLocation = item.Bounds.Location;
4067protected internal void SetItemLocation(ToolStripItem item, Point location)
4125Point mousePosition = WindowsFormsUtils.LastCursorPoint;
4511Point cursorLocation = Cursor.Position;
4597Point 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);
3431internal Point TranslatePoint(Point fromPoint, ToolStripPointType fromPointType, ToolStripPointType toPointType)
3448Point toPoint;
3449Point 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)
1028private HWND GetWindowFromPoint(Point screenCoords, ref bool success)
1055Point pt = screenCoords;
1314Point cursorLocation = Cursor.Position;
1315Point p = cursorLocation;
1402public void Show(string? text, IWin32Window window, Point point)
1421public void Show(string? text, IWin32Window window, Point point, int duration)
1495Point optimalPoint = GetOptimalToolTipPosition(tool, toolRectangle, bubbleSize.Width, bubbleSize.Height);
1547private Point GetOptimalToolTipPosition(IKeyboardToolTip tool, Rectangle toolRectangle, int width, int height)
1790private void SetTool(IWin32Window window, string? text, TipInfo.Type type, Point position)
1927private void Reposition(Point tipPosition, Size tipSize)
1929Point moveToLocation = tipPosition;
1990if (tipInfo.Position != Point.Empty)
2008Point cursorLocation = Cursor.Position;
2024var lpPoint = (Point*)(nint)message.LParamInternal;
2147Point cursorPos = Cursor.Position;
2180if (((tipInfo.TipType & TipInfo.Type.SemiAbsolute) != 0) && tipInfo.Position == Point.Empty)
2202else if ((tipInfo.TipType & TipInfo.Type.SemiAbsolute) != 0 && tipInfo.Position != Point.Empty)
2264tipInfo.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)