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"); }; }
public CustomForm() { InitializeComponent(); lastState = this.WindowState; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; this.Border = new FormBorder(this); }
public NonclientNativeWindow(HtmlUIForm form) { ParentForm = form; FormHandle = form.Handle; AssignHandle(FormHandle); RecalculateSize(); InvalidateWindow(); RecalculateSize(); if (form.Borderless && form.NonclientModeDropShadow) { formBorder = new FormBorder(form); } }
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); } }; }
private void Window_MouseDown(object sender, MouseButtonEventArgs e) { FormBorder.Focus(); }