public CustomForm()
        {
            InitializeComponent();
            InitializeStyles();
            InitializeDragging();

            BackgroundImageLayout = ImageLayout.Tile;
            BackgroundImage       = Properties.Resources.Stone_Bricks;
            Cursor = CustomCursor.Load("Default.CUR");

            TextChanged += delegate { FormBorder.TitleText = Text; FormBorder.Refresh(); };

            StartPosition        = FormStartPosition.CenterScreen;
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            FormBorder.Parent    = this;
            FormBorder.TitleText = Text;

            //BackColor = Color.DarkRed;
            BorderColor     = Color.DarkRed;
            BorderTextColor = Color.Gold;

            BorderSize = 6;

            DoubleBuffered = true;

            MouseDown += delegate { Cursor = CustomCursor.Load("Default_Pressed.CUR"); };
            MouseUp   += delegate { Cursor = CustomCursor.Load("Default.CUR"); };
        }
Beispiel #2
0
 public CustomForm()
 {
     InitializeComponent();
     lastState            = this.WindowState;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
     this.Border          = new FormBorder(this);
 }
Beispiel #3
0
        public NonclientNativeWindow(HtmlUIForm form)
        {
            ParentForm = form;
            FormHandle = form.Handle;
            AssignHandle(FormHandle);
            RecalculateSize();
            InvalidateWindow();
            RecalculateSize();

            if (form.Borderless && form.NonclientModeDropShadow)
            {
                formBorder = new FormBorder(form);
            }
        }
Beispiel #4
0
        public NonclientNativeWindow(HtmlUIForm form)
        {
            NativeMethods.DisableProcessWindowsGhosting();
            NativeMethods.SetWindowTheme(form.Handle, "", "");



            ParentForm = form;
            FormHandle = form.Handle;
            AssignHandle(FormHandle);
            RecalculateSize();
            NativeMethods.InvalidateWindow(FormHandle);
            RecalculateSize();

            if (form.Borderless && form.NonclientModeDropShadow)
            {
                formBorder = new FormBorder(form);
            }
        }
 private void InitializeDragging()
 {
     FormBorder.MouseDown += delegate
     {
         if (FullScreen == false)
         {
             dragging   = true;
             startPoint = FormBorder.PointToClient(Control.MousePosition);
         }
     };
     FormBorder.MouseUp += delegate
     {
         dragging = false;
     };
     FormBorder.MouseMove += delegate
     {
         if (dragging)
         {
             Location = new Point(
                 Control.MousePosition.X - startPoint.X,
                 Control.MousePosition.Y - startPoint.Y);
         }
     };
 }
Beispiel #6
0
 private void Window_MouseDown(object sender, MouseButtonEventArgs e)
 {
     FormBorder.Focus();
 }