public LoginForm(MovieDbEntities context = null) { db = context ?? new MovieDbEntities(); InitializeComponent(); GlassMargins = new Margins(0, 0, 48, 48); }
public HandleBackground(Form form, Margins m) { _margins = m; //Hook form.Paint += new PaintEventHandler(form_Paint); }
public RsMini(RsBrowser rs) { parent = rs; mainForm = rs.parent; if (!Properties.Settings.Default.Resizable) { MessageBox.Show("Mini requires DWM.", "Desktop composition not enabled", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } InitializeComponent(); GlassMargins = new Margins(-3); GlassEnabled = false; Program.RestoreLocationAndSize(this, Properties.Settings.Default.MiniLocation, Properties.Settings.Default.MiniSize); UpdateAspectRatio(); MaximumSize = new Size(MaximumSize.Width, (int)Math.Floor(MaximumSize.Width * AspectRatio)); MinimumSize = new Size((int)Math.Floor(MinimumSize.Width * AspectRatio), MinimumSize.Width); Game = DwmManager.Register(Handle, rs.Handle); Inventory = DwmManager.Register(Handle, rs.Handle); UpdateThumbnails(); if (Settings.Default.MiniVisible) { Show(); } else { Hide(); } }
bool setForeground = true; // variable used to activate mainform without setting rs to foreground #endregion Fields #region Constructors public MainForm() { rs = new RsBrowser(this); cursor = new RsCursor(this); toolbox = new Toolbox(this); settings = new SettingsForm(this); InitializeComponent(); if (Properties.Settings.Default.Resizable) { InitializeThumbnailViewer(); } GlassMargins = new Margins(-3); GlassEnabled = false; AspectRatio = (double)rs.ClientSize.Width / (double)rs.ClientSize.Height; Program.RestoreLocationAndSize(this, Properties.Settings.Default.LastLocation, Properties.Settings.Default.LastSize); idleTimer.Tick += new EventHandler(idleTimer_Tick); }
/// <summary> /// Adds a handler on the Form that enables the user to move the window around /// by clicking on a glass margin (or the title bar, as usual). /// </summary> /// <param name="form">The form that will be controlled.</param> /// <param name="margins">Margins of the glass sheet.</param> /// <remarks> /// Eventual UI elements on the glass sheet will prevent the handler from receiving events /// (except the ThemeText control, which manually redirects mouse events to the form). /// </remarks> public static void HandleFormMovementOnGlass(Form form, Margins margins) { HandleFormMovement tmpHandler = new HandleFormMovement(form, margins); }
/// <summary> /// Adds a handler on the Form that automatically paints the glass background black /// </summary> /// <param name="form">The form that will be controlled.</param> /// <param name="margins">Margins of the glass sheet.</param> public static void HandleBackgroundPainting(Form form, Margins margins) { HandleBackground tmpHandler = new HandleBackground(form, margins); }
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
/// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary> public static void EnableGlassFrame(Form window, Margins margins) { InternalGlassFrame(window.Handle, margins); }
/// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary> public static void EnableGlassFrame(IntPtr hWnd, Margins margins) { InternalGlassFrame(hWnd, margins); }
public HandleFormMovement(Form form, Margins margins) { _margins = margins; //Register handlers form.MouseDown += new MouseEventHandler(form_MouseDown); form.MouseUp += new MouseEventHandler(form_MouseUp); form.MouseMove += new MouseEventHandler(form_MouseMove); }
protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); //Window init KeepAspectRatio = false; GlassEnabled = true; GlassMargins = new Margins(-4); //Opacity = 255; //Window handlers _windowSeeker.OwnerHandle = this.Handle; _msgPumpManager.Initialize(this); //Platform specific form initialization Program.Platform.PostHandleFormInit(this); }
protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); //Window init KeepAspectRatio = false; GlassEnabled = true; GlassMargins = new Margins(-1); //Managers _msgPumpManager.Initialize(this); _windowListManager = new WindowListMenuManager(this, menuWindows); _windowListManager.ParentMenus = new System.Windows.Forms.ContextMenuStrip[] { menuContext, menuFullscreenContext }; //Platform specific form initialization Program.Platform.PostHandleFormInit(this); }
public IgnoreListForm() { InitializeComponent(); GlassMargins = new Margins(0, 0, 0, 32); }
private static void InternalGlassFrame(IntPtr hWnd, Margins margins) { if (!OsSupport.IsVistaOrBetter || !OsSupport.IsCompositionEnabled) return; if (NativeMethods.DwmExtendFrameIntoClientArea(hWnd, ref margins) != 0) throw new DwmCompositionException(String.Format(Resources.ExceptionMessages.NativeCallFailure, "DwmExtendFrameIntoClientArea")); }