Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the VaultForm class.
        /// </summary>
        protected VaultForm()
        {
            this.topBorder         = Resources.BorderTop;
            this.bottomBorder      = Resources.BorderBottom;
            this.sideBorder        = Resources.BorderSide;
            this.bottomRightCorner = Resources.BorderBottomRightCorner;
            this.bottomLeftCorner  = Resources.BorderBottomLeftCorner;
            this.ShowResizeBorders = false;
            this.titleFont         = FontHelper.GetFontAlbertusMTLight(9.5F);
            this.TitleTextColor    = SystemColors.ControlText;

            this.InitializeComponent();

            this.PlaceButtons();

            this.CreateBorderRects();

            #region Apply custom font & scaling

            ScaleControl(this.buttonMaximize);
            ScaleControl(this.buttonMinimize);
            ScaleControl(this.buttonClose);

            #endregion

            this.systemMenu                 = new WindowMenu(this);
            this.systemMenu.SystemEvent    += new EventHandler <WindowMenuEventArgs>(this.SystemMenuSystemEvent);
            this.systemMenu.MaximizeEnabled = this.MaximizeBox;
            this.systemMenu.MinimizeEnabled = this.MinimizeBox;

            // to avoid flickering use double buffer and to force control to use OnPaint
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
        }
Beispiel #2
0
        private void InitForm()
        {
            this.InitializeComponent();

            this.topBorder         = Resources.BorderTop;
            this.bottomBorder      = Resources.BorderBottom;
            this.sideBorder        = Resources.BorderSide;
            this.bottomRightCorner = Resources.BorderBottomRightCorner;
            this.bottomLeftCorner  = Resources.BorderBottomLeftCorner;
            this.ShowResizeBorders = false;

            this.TitleTextColor = SystemColors.ControlText;

            this.PlaceButtons();

            #region Apply custom font & scaling

            ScaleControl(this.UIService, this.buttonMaximize);
            ScaleControl(this.UIService, this.ButtonScaleTo1);
            ScaleControl(this.UIService, this.buttonMinimize);
            ScaleControl(this.UIService, this.buttonClose);

            #endregion

            this.CreateBorderRects();

            // to avoid flickering use double buffer and to force control to use OnPaint
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);


            this.ResizeBegin += new System.EventHandler(this.ResizeBeginCallback);
            this.ResizeEnd   += new System.EventHandler(this.ResizeEndCallback);
            this.Paint       += new System.Windows.Forms.PaintEventHandler(this.PaintCallback);
            this.Resize      += new System.EventHandler(this.ResizeCallback);

            this.systemMenu                  = new WindowMenu(this);
            this.systemMenu.SystemEvent     += new EventHandler <WindowMenuEventArgs>(this.SystemMenuSystemEvent);
            this.systemMenu.MaximizeEnabled  = this.MaximizeBox;
            this.systemMenu.NormalizeEnabled = this.NormalizeBox;
            this.systemMenu.MinimizeEnabled  = this.MinimizeBox;
        }