Example #1
0
 protected YamuiFormShadow(YamuiFormOption formOptions) : base(formOptions)
 {
     HasShadow     = formOptions.HasFlag(YamuiFormOption.WithShadow);
     HasDropShadow = formOptions.HasFlag(YamuiFormOption.WithDropShadow);
     if (HasDropShadow)
     {
         HasShadow = false;
     }
 }
        protected YamuiFormButtons(YamuiFormOption options) : base(options)
        {
            _mainFormToolTip.ShowAlways = true;

            AddWindowButton(WindowButtons.Close);
            AddWindowButton(WindowButtons.CloseAllVisible);
            AddWindowButton(WindowButtons.Maximize);
            AddWindowButton(WindowButtons.Minimize);
        }
Example #3
0
        protected YamuiForm(YamuiFormOption formOptions)
        {
            // why those styles? check here:
            // https://sites.google.com/site/craigandera/craigs-stuff/windows-forms/flicker-free-control-drawing
            SetStyle(
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.DoubleBuffer |
                ControlStyles.Opaque, true);

            // icon
            if (YamuiThemeManager.GlobalIcon != null)
            {
                Icon = YamuiThemeManager.GlobalIcon;
            }

            // init hittest table
            _hitTests = new[] {
                new[] {
                    WinApi.HitTest.HTTOPLEFT, WinApi.HitTest.HTTOP, WinApi.HitTest.HTTOPRIGHT
                },
                new[] {
                    WinApi.HitTest.HTLEFT, WinApi.HitTest.HTCLIENT, WinApi.HitTest.HTRIGHT
                },
                new[] {
                    WinApi.HitTest.HTBOTTOMLEFT, WinApi.HitTest.HTBOTTOM, WinApi.HitTest.HTBOTTOMRIGHT
                },
            };

            AlwaysOnTop        = formOptions.HasFlag(YamuiFormOption.AlwaysOnTop);
            IsPopup            = formOptions.HasFlag(YamuiFormOption.IsPopup);
            DontShowInAltTab   = formOptions.HasFlag(YamuiFormOption.DontShowInAltTab);
            DontActivateOnShow = formOptions.HasFlag(YamuiFormOption.DontActivateOnShow);
            Unselectable       = formOptions.HasFlag(YamuiFormOption.Unselectable);

            if (IsPopup)
            {
                ShowInTaskbar = false;
            }
            SizeGripStyle = SizeGripStyle.Hide;
        }
 protected YamuiFormFadeIn(YamuiFormOption formOptions) : base(formOptions)
 {
 }