/// <summary> /// Forces the creation of the control, including the creation of the handle and any child controls. /// </summary> public void CreateControl() { #if !NDOC //if hosting a native control if (m_native) { //check if a control is already created if (m_childhwnd != IntPtr.Zero) { m_recreating = true; //destroy the existing control Win32Window.DestroyWindow(m_childhwnd); m_childhwnd = IntPtr.Zero; } CreateParams cp = this.CreateParams; //dont create null window if (cp.ClassName != null) { //create the control m_childhwnd = Win32Window.CreateWindowEx(cp.ExStyle, cp.ClassName, cp.Caption, cp.ClassStyle, cp.X, cp.Y, cp.Width, cp.Height, cp.Parent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } m_recreating = false; } #endif }
/// <summary> /// Forces the creation of the control, including the creation of the handle and any child controls. /// </summary> public void CreateControl() { #if !NDOC //if running on device if (!StaticMethods.IsDesignMode(this)) { //check if a control is already created if (childHandle != IntPtr.Zero) { recreating = true; //destroy the existing control Win32Window.DestroyWindow(childHandle); childHandle = IntPtr.Zero; } CreateParams cp = this.CreateParams; //dont create null window if (cp.ClassName != null) { //create the control childHandle = Win32Window.CreateWindowEx(cp.ExStyle, cp.ClassName, cp.Caption, cp.ClassStyle, cp.X, cp.Y, cp.Width, cp.Height, cp.Parent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } } recreating = false; #endif }
public BaseOwnerDrawControl(string className, int style) { //InitializeComponent(); m_hwndControl = Win32Window.CreateWindowEx(0, className, base.Text, (int)WS.CHILD | (int)WS.VISIBLE | style, 0, 0, ClientRectangle.Width, ClientRectangle.Height, Handle, (IntPtr)IdProvider.NewId(Handle), IntPtr.Zero, IntPtr.Zero); }