System\Windows\Forms\Control.cs (30)
651[DefaultValue(typeof(Point), "0, 0")]
652public virtual Point AutoScrollOffset
654get => Properties.GetValueOrDefault(s_autoScrollOffsetProperty, Point.Empty);
655set => Properties.AddOrRemoveValue(s_autoScrollOffsetProperty, value, defaultValue: Point.Empty);
1494PInvoke.GetCursorPos(out Point p);
2419public Point Location
2576public static Point MousePosition
2580PInvoke.GetCursorPos(out Point pt);
4783/// <inheritdoc cref="DoDragDropAsJson{T}(T, DragDropEffects, Bitmap?, Point, bool)"/>
4811Point cursorOffset,
4855/// Because <see cref="DoDragDrop(object, DragDropEffects, Bitmap, Point, bool)"/> always performs the
4866Point cursorOffset,
5212public Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue)
5236public Control? GetChildAtPoint(Point pt) => GetChildAtPoint(pt, GetChildAtPointSkip.None);
7919Point offs = Location;
8075PaintBackground(e, rectangle, BackColor, Point.Empty);
8077internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8101Point scrollLocation = scrollOffset;
8102if (this is ScrollableControl scrollControl && scrollLocation != Point.Empty)
8505public Point PointToClient(Point p)
8514public Point PointToScreen(Point p)
8722Point viewportOrg = default;
8740PrintToMetaFileRecursive(hDC, lParam, new Rectangle(Point.Empty, Size));
8755Point clientOffset = PointToScreen(Point.Empty);
11106Point client;
11559Point location = PARAM.ToPoint(m.LParamInternal);
11560Point screenLocation = PointToScreen(location);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (17)
137Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
138Point p2 = new(bounds.X, bounds.Y); // Upper left
139Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
140Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
192Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
193Point p2 = new(bounds.X, bounds.Y); // Upper left
194Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
195Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
240Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right
241Point p2 = new(bounds.X, bounds.Y); // Upper left
242Point p3 = new(bounds.X, bounds.Y + bounds.Height - 1); // Bottom inner left
243Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right
299Point p1 = new(r.Right - 1, r.Top); // Upper inner right
300Point p2 = new(r.Left, r.Top); // Upper left
301Point p3 = new(r.Left, r.Bottom - 1); // Bottom inner left
302Point p4 = new(r.Right - 1, r.Bottom - 1); // Inner bottom right
374internal 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)
21protected virtual void AccessibilityNotifyCurrentCellChanged(Point cellAddress)
4913private Point ConvertCellToGridCoord(int columnIndex, int rowIndex, int x, int y)
6023Point ptMouse = PointToClient(MousePosition);
9635Point ptMouse = PointToClient(MousePosition);
10392Point firstDisplayedCellAddress = FirstDisplayedCellAddress;
11903Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
12073Point ptOriginalCurrentCell = _ptCurrentCell;
12686Point ptGridCoord = ConvertCellToGridCoord(e.ColumnIndex, e.RowIndex, e.X, e.Y);
15272internal void OnInsertedColumn_PostNotification(Point newCurrentCell)
15305internal void OnInsertedRow_PostNotification(int rowIndex, Point newCurrentCell, bool lastInsertion)
15344internal void OnInsertedRows_PostNotification(DataGridViewRow[] dataGridViewRows, Point newCurrentCell)
15368internal void OnInsertingColumn(int columnIndexInserted, DataGridViewColumn dataGridViewColumn, out Point newCurrentCell)
15526ref Point newCurrentCell,
15612internal void OnInsertingRows(int rowIndexInserted, DataGridViewRow[] dataGridViewRows, ref Point newCurrentCell)
16900internal void OnRemovedColumn_PostNotification(DataGridViewColumn dataGridViewColumn, Point newCurrentCell)
16951internal void OnRemovedRow_PostNotification(DataGridViewRow dataGridViewRow, Point newCurrentCell)
17029internal void OnRemovingColumn(DataGridViewColumn dataGridViewColumn, out Point newCurrentCell, bool force)
17242internal void OnRemovingRow(int rowIndexDeleted, out Point newCurrentCell, bool force)
18815Point pt = PointToScreen(Location);
26003Point ptMouse = PointToClient(MousePosition);
29165Point ptMouse = PointToClient(MousePosition);
29875Point ptMouse = PointToClient(MousePosition);
29973Point 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);
2594Point screenPoint = EditTextBox.PointToScreen(e.Location);
2604_rowSelectPos = Point.Empty;
2968Point pos = FindPosition(e.X, e.Y);
3014Point point;
3271Point startPosition = FindPosition(clipRect.X, clipRect.Y);
3272Point endPosition = FindPosition(clipRect.X, clipRect.Y + clipRect.Height);
3288Point location = _location;
3438Point editPoint = PointToScreen(_lastMouseDown);
3452_rowSelectPos = Point.Empty;
3786Point location = parent.PointToScreen(new(rect.left, rect.top));
4864Point location = topControl.Location;
5249Point mouseLoc = Cursor.Position;
5267Point tipPt = Point.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (23)
28internal static Point s_invalidMouseEnter = new(int.MaxValue, int.MaxValue);
70private Point _mouseEnterWhenShown = s_invalidMouseEnter;
252public new Point AutoScrollPosition
2140Point midPointOfCurrent = new(selectedItem.Bounds.X + selectedItem.Width / 2,
2164Point otherItemMidLocation = new(otherItem.Bounds.X + otherItem.Width / 2, (down) ? otherItem.Bounds.Top : otherItem.Bounds.Bottom);
2600Point 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);
3786g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3793g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3800g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3813g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3820g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3827g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
3850public new Control? GetChildAtPoint(Point point) => base.GetChildAtPoint(point);
3853public new Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue) => base.GetChildAtPoint(pt, skipValue);
3870public ToolStripItem? GetItemAt(Point point)
4049Point newLocation = item.Bounds.Location;
4060protected internal void SetItemLocation(ToolStripItem item, Point location)
4118Point mousePosition = WindowsFormsUtils.LastCursorPoint;
4507Point cursorLocation = Cursor.Position;
4588Point 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(IComDataObject dataObject, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2370Point rectangleLocation = TranslatePoint(r.Location, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ToolStripCoords);
3422internal Point TranslatePoint(Point fromPoint, ToolStripPointType fromPointType, ToolStripPointType toPointType)
3439Point toPoint;
3440Point 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\ToolStripRenderer.cs (4)
618Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2);
622Point[]? arrow = null;
797e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel);
882TextRenderer.DrawText(textGraphics, text, textFont, new Rectangle(Point.Empty, textSize), textColor, textFormat);
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (9)
279Rectangle bounds = new(Point.Empty, e.GripBounds.Size);
388vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
394DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down));
421Rectangle bounds = new(Point.Empty, item.Size);
444Rectangle fillRect = new(Point.Empty, item.Size);
490RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical);
530Rectangle bounds = new(Point.Empty, splitButton.Size);
656vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size));
668RenderSmall3DBorderInternal(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)