Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsDesignMode && Borderless)
            {
                if (IsNonclientMode)
                {
                    nativeForm = new NonclientNativeWindow(this);
                }
                else
                {
                    IntPtr dwAttr = new IntPtr(1);
                    NativeMethods.DwmSetWindowAttribute(Handle, 2, dwAttr, 4);

                    Padding = new Padding(Padding.Left + BorderSize, Padding.Top + BorderSize, Padding.Right + BorderSize, Padding.Bottom + BorderSize);
                }
            }
            base.OnLoad(e);
        }
Beispiel #2
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsDesignMode)
            {
                if (IsNonclientMode)
                {
                    //NativeMethods.DisableProcessWindowsGhosting();
                    NativeMethods.SetWindowTheme(Handle, string.Empty, string.Empty);
                    nativeForm = new NonclientNativeWindow(this);
                }
                else
                {
                    IntPtr dwAttr = new IntPtr(1);
                    NativeMethods.DwmSetWindowAttribute(Handle, 2, dwAttr, 4);

                    Padding = new Padding(Padding.Left + BorderSize, Padding.Top + BorderSize, Padding.Right + BorderSize, Padding.Bottom + BorderSize);
                }
            }
            base.OnLoad(e);
        }