System.Windows.Forms.XplatUICarbon.SetParent C# (CSharp) Method

SetParent() private method

private SetParent ( IntPtr handle, IntPtr parent ) : IntPtr
handle System.IntPtr
parent System.IntPtr
return System.IntPtr
		internal override IntPtr SetParent(IntPtr handle, IntPtr parent) {
			IntPtr ParentHandle = IntPtr.Zero;
			Hwnd hwnd = Hwnd.ObjectFromHandle (handle);
			
			hwnd.Parent = Hwnd.ObjectFromHandle (parent);
			if (HIViewGetSuperview (hwnd.whole_window) != IntPtr.Zero) {
				HIViewRemoveFromSuperview (hwnd.whole_window);
			}
			if (hwnd.parent == null)
				HIViewFindByID (HIViewGetRoot (FosterParent), new Carbon.HIViewID (Carbon.EventHandler.kEventClassWindow, 1), ref ParentHandle);
			HIViewAddSubview (hwnd.parent == null ? ParentHandle : hwnd.Parent.client_window, hwnd.whole_window);
			HIViewPlaceInSuperviewAt (hwnd.whole_window, hwnd.X, hwnd.Y);
			HIViewAddSubview (hwnd.whole_window, hwnd.client_window);
			HIViewPlaceInSuperviewAt (hwnd.client_window, hwnd.ClientRect.X, hwnd.ClientRect.Y);
			
			return IntPtr.Zero;
		}
		
XplatUICarbon