System.Windows.Forms.Control.PointToScreen C# (CSharp) Method

PointToScreen() public method

public PointToScreen ( Point p ) : Point
p Point
return Point
		public Point PointToScreen (Point p)
		{
			int x = p.X;
			int y = p.Y;
			//TODO: FIXME
			//XplatUI.ClientToScreen(Handle, ref x, ref y);
			
			return new Point (x, y);
		}

Usage Example

		public static Size GetTipSize(Control control, Graphics graphics, TipSection tipData)
		{
			Size tipSize = Size.Empty;
			SizeF tipSizeF = SizeF.Empty;
			
			RectangleF workingArea = GetWorkingArea(control);
			
			PointF screenLocation = control.PointToScreen(Point.Empty);
			
			SizeF maxLayoutSize = new SizeF(workingArea.Right - screenLocation.X - HorizontalBorder * 2,
			                                workingArea.Bottom - screenLocation.Y - VerticalBorder * 2);
			
			if (maxLayoutSize.Width > 0 && maxLayoutSize.Height > 0) {
				graphics.TextRenderingHint =
					TextRenderingHint.AntiAliasGridFit;
				
				tipData.SetMaximumSize(maxLayoutSize);
				tipSizeF = tipData.GetRequiredSize();
				tipData.SetAllocatedSize(tipSizeF);
				
				tipSizeF += new SizeF(HorizontalBorder * 2,
				                      VerticalBorder   * 2);
				tipSize = Size.Ceiling(tipSizeF);
			}
			
			if (control.ClientSize != tipSize) {
				control.ClientSize = tipSize;
			}
			
			return tipSize;
		}
All Usage Examples Of System.Windows.Forms.Control::PointToScreen
Control