System\Windows\Forms\Control.cs (30)
719[DefaultValue(typeof(Point), "0, 0")]
720public virtual Point AutoScrollOffset
722get => Properties.GetValueOrDefault(s_autoScrollOffsetProperty, Point.Empty);
723set => Properties.AddOrRemoveValue(s_autoScrollOffsetProperty, value, defaultValue: Point.Empty);
1562PInvoke.GetCursorPos(out Point p);
2487public Point Location
2644public static Point MousePosition
2648PInvoke.GetCursorPos(out Point pt);
4851/// <inheritdoc cref="DoDragDropAsJson{T}(T, DragDropEffects, Bitmap?, Point, bool)"/>
4879Point cursorOffset,
4923/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
4934Point cursorOffset,
5280public Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue)
5304public Control? GetChildAtPoint(Point pt) => GetChildAtPoint(pt, GetChildAtPointSkip.None);
7984Point offs = Location;
8131PaintBackground(e, rectangle, BackColor, Point.Empty);
8133internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8157Point scrollLocation = scrollOffset;
8158if (this is ScrollableControl scrollControl && scrollLocation != Point.Empty)
8561public Point PointToClient(Point p)
8570public Point PointToScreen(Point p)
8778Point viewportOrg = default;
8796PrintToMetaFileRecursive(hDC, lParam, new Rectangle(Point.Empty, Size));
8811Point clientOffset = PointToScreen(Point.Empty);
11180Point client;
11630Point location = PARAM.ToPoint(m.LParamInternal);
11631Point 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)
4910private Point ConvertCellToGridCoord(int columnIndex, int rowIndex, int x, int y)
6020Point ptMouse = PointToClient(MousePosition);
9632Point ptMouse = PointToClient(MousePosition);
10389Point firstDisplayedCellAddress = FirstDisplayedCellAddress;
11900Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
12070Point ptOriginalCurrentCell = _ptCurrentCell;
12683Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
15269internal void OnInsertedColumn_PostNotification(Point newCurrentCell)
15302internal void OnInsertedRow_PostNotification(int rowIndex, Point newCurrentCell, bool lastInsertion)
15341internal void OnInsertedRows_PostNotification(DataGridViewRow[] dataGridViewRows, Point newCurrentCell)
15365internal void OnInsertingColumn(int columnIndexInserted, DataGridViewColumn dataGridViewColumn, out Point newCurrentCell)
15523ref Point newCurrentCell,
15609internal void OnInsertingRows(int rowIndexInserted, DataGridViewRow[] dataGridViewRows, ref Point newCurrentCell)
16894internal void OnRemovedColumn_PostNotification(DataGridViewColumn dataGridViewColumn, Point newCurrentCell)
16945internal void OnRemovedRow_PostNotification(DataGridViewRow dataGridViewRow, Point newCurrentCell)
17023internal void OnRemovingColumn(DataGridViewColumn dataGridViewColumn, out Point newCurrentCell, bool force)
17236internal void OnRemovingRow(int rowIndexDeleted, out Point newCurrentCell, bool force)
18809Point pt = PointToScreen(Location);
25994Point ptMouse = PointToClient(MousePosition);
29157Point ptMouse = PointToClient(MousePosition);
29867Point ptMouse = PointToClient(MousePosition);
29962Point client;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (29)
23private static Point InvalidPoint { get; } = new(int.MinValue, int.MinValue);
53private static Point InvalidPosition { get; } = new(int.MinValue, int.MinValue);
91private Point _location = new(1, 1);
96private Point _rowSelectPos = Point.Empty; // the position that we clicked on a row to test for double clicks
97private Point _lastMouseDown = InvalidPosition;
450public Point ContextMenuDefaultLocation
456Point point = PointToScreen(new(rect.X, rect.Y));
602Point pt = new(rect.X, rect.Y);
675private static void AdjustOrigin(Graphics g, Point newOrigin, ref Rectangle r)
1102Point newOrigin = new(rect.X, rect.Y);
1157Point newOrigin = new(rect.X, rect.Y);
1419Point location = PointToScreen(new Point(0, 0));
1644private Point FindPosition(int x, int y)
1658Point pt = new(RowLabel, 0);
2604Point screenPoint = EditTextBox.PointToScreen(e.Location);
2614_rowSelectPos = Point.Empty;
2983Point pos = FindPosition(e.X, e.Y);
3029Point point;
3286Point startPosition = FindPosition(clipRect.X, clipRect.Y);
3287Point endPosition = FindPosition(clipRect.X, clipRect.Y + clipRect.Height);
3303Point location = _location;
3453Point editPoint = PointToScreen(_lastMouseDown);
3467_rowSelectPos = Point.Empty;
3801Point location = parent.PointToScreen(new(rect.left, rect.top));
4873Point location = topControl.Location;
5255Point mouseLoc = Cursor.Position;
5273Point 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)
556client.Location = Point.Empty;
2153/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
2160public unsafe DragDropEffects DoDragDrop(object data, DragDropEffects allowedEffects, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2219internal IDropSource.Interface CreateDropSource(IComVisibleDataObject dataObject, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2372Point rectangleLocation = TranslatePoint(r.Location, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ToolStripCoords);
3426internal Point TranslatePoint(Point fromPoint, ToolStripPointType fromPointType, ToolStripPointType toPointType)
3443Point toPoint;
3444Point 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);
347Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty);
417Rectangle bounds = new(Point.Empty, toolStrip.Size);
546Rectangle bounds = new(Point.Empty, item.Size);
769e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel);
846Rectangle bounds = new(Point.Empty, toolStrip.Size);
853Point topLeft = Point.Empty;
854Point topRight = new(bounds.Width - 1, 0);
855Point bottomLeft = new(0, bounds.Height - 1);
856Point bottomRight = new(bounds.Width - 1, bounds.Height - 1);
1108Rectangle bounds = new(Point.Empty, item.Size);
1134g.FillRectangle(brush, new Rectangle(Point.Empty, control.Size));
1141Rectangle gradientBounds = new(Point.Empty, parent.Size);
1150g.FillRectangle(b, new Rectangle(Point.Empty, control.Size));
1155Rectangle gradientBounds = new(Point.Empty, control.Size);
1174Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1183Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1195Rectangle bounds = new(Point.Empty, toolStripDropDown.Size);
1217Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size);
1270Point start = new(overflowBoundsFill.Left - 1, overflowBoundsFill.Height - 2);
1271Point end = new(overflowBoundsFill.Left, overflowBoundsFill.Height - 2);
1298Point top1 = new(overflowBoundsFill.X - 2, 0);
1299Point top2 = new(overflowBoundsFill.X - 1, 1);
1338Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1344Point topLeft = Point.Empty;
1345Point topRight = new(bounds.Width - 1, 0);
1346Point bottomLeft = new(0, bounds.Height - 1);
1388Point gradientCopyPixel = bottomLeft;
1567Rectangle bounds = new(Point.Empty, item.Size);
1646private static Point RenderArrowInternal(Graphics g, Rectangle dropDownRect, ArrowDirection direction, Brush brush)
1648Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2);
1653Point[] arrow = direction switch
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (9)
333Rectangle bounds = new(Point.Empty, e.GripBounds.Size);
443vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
449DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down));
476Rectangle bounds = new(Point.Empty, item.Size);
499Rectangle fillRect = new(Point.Empty, item.Size);
545RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical);
657Rectangle bounds = new(Point.Empty, splitButton.Size);
717vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
729RenderSmall3DBorderInternal(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)