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

GetRealChildAtPoint() private method

private GetRealChildAtPoint ( Point pt ) : Control
pt Point
return Control
		internal Control GetRealChildAtPoint (Point pt)
		{
			foreach (Control control in child_controls.GetAllControls ())
			{
				if (control.Bounds.Contains (PointToClient (pt)))
				{
					Control child = control.GetRealChildAtPoint (pt);
					if (child == null)
						return control;
					else
						return child;
				}
			}
			
			return null;
		}

Usage Example

Example #1
0
        private void UpdateCursor()
        {
            Control child_control = GrabControl.GetRealChildAtPoint(Cursor.Position);

            if (child_control != null)
            {
                if (active)
                {
                    XplatUI.SetCursor(child_control.Handle, Cursors.Default.handle);
                }
                else
                {
                    XplatUI.SetCursor(child_control.Handle, child_control.Cursor.handle);
                }
            }
        }
Control