From 13309c13324354ba907b147281f14593e42a20aa Mon Sep 17 00:00:00 2001 From: orapps44 <77468294+orapps44@users.noreply.github.com> Date: Sun, 6 Jun 2021 21:31:24 +0200 Subject: [PATCH 1/5] Add FormStyle property to MaterialForm + Fix left form resizing Add FormStyle property to change Action bar height to 40, 48, 56, 64px or to diasable Action and/or status bar. Fix form left resizing not working when drawer is present. --- MaterialSkin/Controls/MaterialForm.cs | 247 ++++++++++++++++++-------- 1 file changed, 170 insertions(+), 77 deletions(-) diff --git a/MaterialSkin/Controls/MaterialForm.cs b/MaterialSkin/Controls/MaterialForm.cs index 15e20dbd..cfa3357c 100644 --- a/MaterialSkin/Controls/MaterialForm.cs +++ b/MaterialSkin/Controls/MaterialForm.cs @@ -37,6 +37,77 @@ public override string Text [Category("Layout")] public bool Sizable { get; set; } + public enum FormStyles + { + StatusAndActionBar_None, + ActionBar_None, + ActionBar_40, + ActionBar_48, + ActionBar_56, + ActionBar_64, + } + + private FormStyles _formStyle; + [Category("Material Skin"), Browsable(true), DisplayName("Form Style"), DefaultValue(FormStyles.ActionBar_40)] + public FormStyles FormStyle + { + get { return _formStyle; } + set + { + _formStyle = value; + if (_formStyle == FormStyles.StatusAndActionBar_None) + { + ACTION_BAR_HEIGHT = 0; + STATUS_BAR_HEIGHT = 0; + } + else if (_formStyle == FormStyles.ActionBar_None) + { + ACTION_BAR_HEIGHT = 0; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + else if (_formStyle == FormStyles.ActionBar_40) + { + ACTION_BAR_HEIGHT = ACTION_BAR_HEIGHT_DEFAULT; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + else if (_formStyle == FormStyles.ActionBar_48) + { + ACTION_BAR_HEIGHT = 48; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + else if (_formStyle == FormStyles.ActionBar_56) + { + ACTION_BAR_HEIGHT = 56; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + else if (_formStyle == FormStyles.ActionBar_64) + { + ACTION_BAR_HEIGHT = 64; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + else + { + ACTION_BAR_HEIGHT = ACTION_BAR_HEIGHT_DEFAULT; + STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT_DEFAULT; + } + + Padding = new Padding(Padding.Left, STATUS_BAR_HEIGHT + ACTION_BAR_HEIGHT, Padding.Right, Padding.Bottom); + + if (DrawerTabControl != null) + { + int H = Size.Height - (STATUS_BAR_HEIGHT + ACTION_BAR_HEIGHT); + int Y = Location.Y + (STATUS_BAR_HEIGHT + ACTION_BAR_HEIGHT); + drawerOverlay.Size = new Size(Size.Width, H); + drawerOverlay.Location = new Point(Location.X, Y); + drawerForm.Size = new Size(DrawerWidth, H); + drawerForm.Location = new Point(Location.X, Y); + } + + UpdateRects(); + Invalidate(); + } + } + [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); @@ -55,6 +126,9 @@ public override string Text [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern bool GetMonitorInfo(HandleRef hmonitor, [In, Out] MONITORINFOEX info); + private Form drawerOverlay = new Form(); + private Form drawerForm = new Form(); + public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; public const int WM_MOUSEMOVE = 0x0200; @@ -96,9 +170,14 @@ public override string Text {HTBOTTOMRIGHT, WMSZ_BOTTOMRIGHT} }; - private const int STATUS_BAR_BUTTON_WIDTH = STATUS_BAR_HEIGHT; - private const int STATUS_BAR_HEIGHT = 24; - private const int ACTION_BAR_HEIGHT = 40; + private const int STATUS_BAR_BUTTON_WIDTH = 24; + private const int STATUS_BAR_HEIGHT_DEFAULT = 24; + private int STATUS_BAR_HEIGHT = 24; + private const int ICON_SIZE = 24; + private const int TITLE_LEFT_PADDING = 72; + private const int ACTION_BAR_PADDING = 16; + private const int ACTION_BAR_HEIGHT_DEFAULT = 40; + private int ACTION_BAR_HEIGHT = 40; private const uint TPM_LEFTALIGN = 0x0000; private const uint TPM_RETURNCMD = 0x0100; private const int WM_SYSCOMMAND = 0x0112; @@ -199,6 +278,7 @@ public MaterialForm() Sizable = true; DoubleBuffered = true; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); + FormStyle = FormStyles.ActionBar_40; Padding = new Padding(3, STATUS_BAR_HEIGHT + ACTION_BAR_HEIGHT, 3, 3); //Keep space for resize by mouse @@ -367,9 +447,6 @@ public bool DrawerBackgroundWithAccent protected void AddDrawerOverlayForm() { - Form drawerOverlay = new Form(); - Form drawerForm = new Form(); - if (DrawerTabControl == null) return; @@ -474,6 +551,12 @@ protected void AddDrawerOverlayForm() drawerControl.Hide(); }; + //Resize form when mouse over drawer + drawerControl.MouseDown += (sender, e) => + { + ResizeForm(_resizeDir); + }; + // Animation and visibility drawerControl.DrawerBeginOpen += (sender) => { @@ -660,7 +743,7 @@ protected override void OnMouseMove(MouseEventArgs e) _resizeDir = ResizeDirection.BottomLeft; Cursor = Cursors.SizeNESW; } - else if (e.Location.X < BORDER_WIDTH && !isChildUnderMouse && !_maximized) + else if (e.Location.X < BORDER_WIDTH && (!isChildUnderMouse || DrawerTabControl != null) && !_maximized) { _resizeDir = ResizeDirection.Left; Cursor = Cursors.SizeWE; @@ -815,10 +898,12 @@ private void ResizeForm(ResizeDirection direction) { case ResizeDirection.BottomLeft: dir = HTBOTTOMLEFT; + Cursor = Cursors.SizeNESW; break; case ResizeDirection.Left: dir = HTLEFT; + Cursor = Cursors.SizeWE; break; case ResizeDirection.Right: @@ -844,26 +929,27 @@ private void ResizeForm(ResizeDirection direction) protected override void OnResize(EventArgs e) { base.OnResize(e); + UpdateRects(); + } + private void UpdateRects() + { _minButtonBounds = new Rectangle((Width) - 3 * STATUS_BAR_BUTTON_WIDTH, 0, STATUS_BAR_BUTTON_WIDTH, STATUS_BAR_HEIGHT); _maxButtonBounds = new Rectangle((Width) - 2 * STATUS_BAR_BUTTON_WIDTH, 0, STATUS_BAR_BUTTON_WIDTH, STATUS_BAR_HEIGHT); _xButtonBounds = new Rectangle((Width) - STATUS_BAR_BUTTON_WIDTH, 0, STATUS_BAR_BUTTON_WIDTH, STATUS_BAR_HEIGHT); _statusBarBounds = new Rectangle(0, 0, Width, STATUS_BAR_HEIGHT); _actionBarBounds = new Rectangle(0, STATUS_BAR_HEIGHT, Width, ACTION_BAR_HEIGHT); - _drawerButtonBounds = new Rectangle(SkinManager.FORM_PADDING / 2, STATUS_BAR_HEIGHT, 24 + SkinManager.FORM_PADDING + SkinManager.FORM_PADDING / 2, ACTION_BAR_HEIGHT); + _drawerButtonBounds = new Rectangle((SkinManager.FORM_PADDING / 2)+3, STATUS_BAR_HEIGHT + (ACTION_BAR_HEIGHT/2) - (ACTION_BAR_HEIGHT_DEFAULT/2), ACTION_BAR_HEIGHT_DEFAULT, ACTION_BAR_HEIGHT_DEFAULT); } protected override void OnPaint(PaintEventArgs e) { + var hoverBrush = SkinManager.BackgroundHoverBrush; + var downBrush = SkinManager.BackgroundFocusBrush; var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.Clear(SkinManager.BackdropColor); - if (ControlBox == true) - { - g.FillRectangle(SkinManager.ColorScheme.DarkPrimaryBrush, _statusBarBounds); - g.FillRectangle(SkinManager.ColorScheme.PrimaryBrush, _actionBarBounds); - } //Draw border using (var borderPen = new Pen(SkinManager.DividersColor, 1)) @@ -873,82 +959,89 @@ protected override void OnPaint(PaintEventArgs e) g.DrawLine(borderPen, new Point(0, Height - 1), new Point(Width - 1, Height - 1)); } - // Determine whether or not we even should be drawing the buttons. - bool showMin = MinimizeBox && ControlBox; - bool showMax = MaximizeBox && ControlBox; - var hoverBrush = SkinManager.BackgroundHoverBrush; - var downBrush = SkinManager.BackgroundFocusBrush; - - // When MaximizeButton == false, the minimize button will be painted in its place - if (_buttonState == ButtonState.MinOver && showMin) - g.FillRectangle(hoverBrush, showMax ? _minButtonBounds : _maxButtonBounds); + if (_formStyle != FormStyles.StatusAndActionBar_None) + { + if (ControlBox == true) + { + g.FillRectangle(SkinManager.ColorScheme.DarkPrimaryBrush, _statusBarBounds); + g.FillRectangle(SkinManager.ColorScheme.PrimaryBrush, _actionBarBounds); + } - if (_buttonState == ButtonState.MinDown && showMin) - g.FillRectangle(downBrush, showMax ? _minButtonBounds : _maxButtonBounds); + // Determine whether or not we even should be drawing the buttons. + bool showMin = MinimizeBox && ControlBox; + bool showMax = MaximizeBox && ControlBox; - if (_buttonState == ButtonState.MaxOver && showMax) - g.FillRectangle(hoverBrush, _maxButtonBounds); + // When MaximizeButton == false, the minimize button will be painted in its place + if (_buttonState == ButtonState.MinOver && showMin) + g.FillRectangle(hoverBrush, showMax ? _minButtonBounds : _maxButtonBounds); - if (_buttonState == ButtonState.MaxDown && showMax) - g.FillRectangle(downBrush, _maxButtonBounds); + if (_buttonState == ButtonState.MinDown && showMin) + g.FillRectangle(downBrush, showMax ? _minButtonBounds : _maxButtonBounds); - if (_buttonState == ButtonState.XOver && ControlBox) - g.FillRectangle(SkinManager.BackgroundHoverRedBrush, _xButtonBounds); + if (_buttonState == ButtonState.MaxOver && showMax) + g.FillRectangle(hoverBrush, _maxButtonBounds); - if (_buttonState == ButtonState.XDown && ControlBox) - g.FillRectangle(SkinManager.BackgroundDownRedBrush, _xButtonBounds); + if (_buttonState == ButtonState.MaxDown && showMax) + g.FillRectangle(downBrush, _maxButtonBounds); - using (var formButtonsPen = new Pen(SkinManager.ColorScheme.TextColor, 2)) - { - // Minimize button. - if (showMin) - { - int x = showMax ? _minButtonBounds.X : _maxButtonBounds.X; - int y = showMax ? _minButtonBounds.Y : _maxButtonBounds.Y; + if (_buttonState == ButtonState.XOver && ControlBox) + g.FillRectangle(SkinManager.BackgroundHoverRedBrush, _xButtonBounds); - g.DrawLine( - formButtonsPen, - x + (int)(_minButtonBounds.Width * 0.33), - y + (int)(_minButtonBounds.Height * 0.66), - x + (int)(_minButtonBounds.Width * 0.66), - y + (int)(_minButtonBounds.Height * 0.66) - ); - } + if (_buttonState == ButtonState.XDown && ControlBox) + g.FillRectangle(SkinManager.BackgroundDownRedBrush, _xButtonBounds); - // Maximize button - if (showMax) + using (var formButtonsPen = new Pen(SkinManager.ColorScheme.TextColor, 2)) { - g.DrawRectangle( - formButtonsPen, - _maxButtonBounds.X + (int)(_maxButtonBounds.Width * 0.33), - _maxButtonBounds.Y + (int)(_maxButtonBounds.Height * 0.36), - (int)(_maxButtonBounds.Width * 0.39), - (int)(_maxButtonBounds.Height * 0.31) - ); - } + // Minimize button. + if (showMin) + { + int x = showMax ? _minButtonBounds.X : _maxButtonBounds.X; + int y = showMax ? _minButtonBounds.Y : _maxButtonBounds.Y; + + g.DrawLine( + formButtonsPen, + x + (int)(_minButtonBounds.Width * 0.33), + y + (int)(_minButtonBounds.Height * 0.66), + x + (int)(_minButtonBounds.Width * 0.66), + y + (int)(_minButtonBounds.Height * 0.66) + ); + } - // Close button - if (ControlBox) - { - g.DrawLine( - formButtonsPen, - _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33), - _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33), - _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66), - _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66) - ); + // Maximize button + if (showMax) + { + g.DrawRectangle( + formButtonsPen, + _maxButtonBounds.X + (int)(_maxButtonBounds.Width * 0.33), + _maxButtonBounds.Y + (int)(_maxButtonBounds.Height * 0.36), + (int)(_maxButtonBounds.Width * 0.39), + (int)(_maxButtonBounds.Height * 0.31) + ); + } - g.DrawLine( - formButtonsPen, - _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66), - _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33), - _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33), - _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66)); + // Close button + if (ControlBox) + { + g.DrawLine( + formButtonsPen, + _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33), + _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33), + _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66), + _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66) + ); + + g.DrawLine( + formButtonsPen, + _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66), + _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33), + _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33), + _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66)); + } } } // Drawer Icon - if (DrawerTabControl != null) + if (DrawerTabControl != null && _formStyle != FormStyles.ActionBar_None && _formStyle != FormStyles.StatusAndActionBar_None) { if (_buttonState == ButtonState.DrawerOver) g.FillRectangle(hoverBrush, _drawerButtonBounds); @@ -956,7 +1049,7 @@ protected override void OnPaint(PaintEventArgs e) if (_buttonState == ButtonState.DrawerDown) g.FillRectangle(downBrush, _drawerButtonBounds); - _drawerIconRect = new Rectangle(SkinManager.FORM_PADDING / 2, STATUS_BAR_HEIGHT, 24 + SkinManager.FORM_PADDING + SkinManager.FORM_PADDING / 2, ACTION_BAR_HEIGHT); + _drawerIconRect = new Rectangle(SkinManager.FORM_PADDING / 2, STATUS_BAR_HEIGHT, ACTION_BAR_HEIGHT_DEFAULT, ACTION_BAR_HEIGHT); // Ripple if (_clickAnimManager.IsAnimating()) { @@ -999,12 +1092,12 @@ protected override void OnPaint(PaintEventArgs e) } } - if (ControlBox==true) + if (ControlBox== true && _formStyle != FormStyles.ActionBar_None && _formStyle != FormStyles.StatusAndActionBar_None) { //Form title using (NativeTextRenderer NativeText = new NativeTextRenderer(g)) { - Rectangle textLocation = new Rectangle(SkinManager.FORM_PADDING + (DrawerTabControl != null ? 24 + (int)(SkinManager.FORM_PADDING * 1.5) : 0), STATUS_BAR_HEIGHT, Width, ACTION_BAR_HEIGHT); + Rectangle textLocation = new Rectangle(DrawerTabControl != null ? TITLE_LEFT_PADDING : TITLE_LEFT_PADDING - (ICON_SIZE + (ACTION_BAR_PADDING*2)), STATUS_BAR_HEIGHT, Width, ACTION_BAR_HEIGHT); NativeText.DrawTransparentText(Text, SkinManager.getLogFontByType(MaterialSkinManager.fontType.H6), SkinManager.ColorScheme.TextColor, textLocation.Location, From 3814587654a41685cbc9123b90e3f54349de3f0b Mon Sep 17 00:00:00 2001 From: orapps44 <77468294+orapps44@users.noreply.github.com> Date: Sun, 6 Jun 2021 22:55:39 +0200 Subject: [PATCH 2/5] Update MainForm.cs --- MaterialSkinExample/MainForm.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/MaterialSkinExample/MainForm.cs b/MaterialSkinExample/MainForm.cs index b9fedc94..d9334f6a 100644 --- a/MaterialSkinExample/MainForm.cs +++ b/MaterialSkinExample/MainForm.cs @@ -37,6 +37,20 @@ public MainForm() materialCheckedListBox1.Items.Add("Item7", false); materialComboBox6.SelectedIndex = 0; + + materialListBoxFormStyle.Clear(); + foreach (var FormStyleItem in Enum.GetNames(typeof(MaterialForm.FormStyles))) + { + materialListBoxFormStyle.AddItem(FormStyleItem); + if (FormStyleItem == this.FormStyle.ToString()) materialListBoxFormStyle.SelectedIndex = materialListBoxFormStyle.Items.Count-1; + } + + materialListBoxFormStyle.SelectedIndexChanged += (sender, args) => + { + MaterialForm.FormStyles SelectedStyle = (MaterialForm.FormStyles)Enum.Parse(typeof(MaterialForm.FormStyles), args.Text); + if (this.FormStyle!= SelectedStyle) this.FormStyle = SelectedStyle; + }; + } private void seedListView() @@ -169,5 +183,11 @@ private void materialSwitch9_CheckedChanged(object sender, EventArgs e) { DrawerAutoShow = materialSwitch9.Checked; } + + private void materialTextBox2_LeadingIconClick(object sender, EventArgs e) + { + + } + } } From d78697e08243ef21b004b5f5a07e1c2c2088c989 Mon Sep 17 00:00:00 2001 From: orapps44 <77468294+orapps44@users.noreply.github.com> Date: Sun, 6 Jun 2021 23:01:21 +0200 Subject: [PATCH 3/5] Update MainForm.Designer.cs --- MaterialSkinExample/MainForm.Designer.cs | 35 +++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/MaterialSkinExample/MainForm.Designer.cs b/MaterialSkinExample/MainForm.Designer.cs index c46ec723..f3a2fe8d 100644 --- a/MaterialSkinExample/MainForm.Designer.cs +++ b/MaterialSkinExample/MainForm.Designer.cs @@ -57,6 +57,8 @@ private void InitializeComponent() this.materialCheckbox1 = new MaterialSkin.Controls.MaterialCheckbox(); this.materialTabControl1 = new MaterialSkin.Controls.MaterialTabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.materialLabel52 = new MaterialSkin.Controls.MaterialLabel(); + this.materialListBoxFormStyle = new MaterialSkin.Controls.MaterialListBox(); this.MaterialButton3 = new MaterialSkin.Controls.MaterialButton(); this.materialSwitch8 = new MaterialSkin.Controls.MaterialSwitch(); this.materialLabel24 = new MaterialSkin.Controls.MaterialLabel(); @@ -279,6 +281,8 @@ private void InitializeComponent() // tabPage1 // this.tabPage1.BackColor = System.Drawing.Color.White; + this.tabPage1.Controls.Add(this.materialLabel52); + this.tabPage1.Controls.Add(this.materialListBoxFormStyle); this.tabPage1.Controls.Add(this.MaterialButton3); this.tabPage1.Controls.Add(this.materialSwitch8); this.tabPage1.Controls.Add(this.materialLabel24); @@ -297,6 +301,33 @@ private void InitializeComponent() this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Home"; // + // materialLabel52 + // + this.materialLabel52.AutoSize = true; + this.materialLabel52.Depth = 0; + this.materialLabel52.Font = new System.Drawing.Font("Roboto", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel); + this.materialLabel52.FontType = MaterialSkin.MaterialSkinManager.fontType.H5; + this.materialLabel52.Location = new System.Drawing.Point(642, 69); + this.materialLabel52.MouseState = MaterialSkin.MouseState.HOVER; + this.materialLabel52.Name = "materialLabel52"; + this.materialLabel52.Size = new System.Drawing.Size(113, 29); + this.materialLabel52.TabIndex = 39; + this.materialLabel52.Text = "Form style"; + // + // materialListBoxFormStyle + // + this.materialListBoxFormStyle.BackColor = System.Drawing.Color.White; + this.materialListBoxFormStyle.BorderColor = System.Drawing.Color.LightGray; + this.materialListBoxFormStyle.Depth = 0; + this.materialListBoxFormStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + this.materialListBoxFormStyle.Location = new System.Drawing.Point(635, 102); + this.materialListBoxFormStyle.MouseState = MaterialSkin.MouseState.HOVER; + this.materialListBoxFormStyle.Name = "materialListBoxFormStyle"; + this.materialListBoxFormStyle.SelectedIndex = -1; + this.materialListBoxFormStyle.SelectedItem = null; + this.materialListBoxFormStyle.Size = new System.Drawing.Size(225, 258); + this.materialListBoxFormStyle.TabIndex = 38; + // // MaterialButton3 // this.MaterialButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; @@ -1762,6 +1793,7 @@ private void InitializeComponent() this.materialTextBox2.TabIndex = 3; this.materialTextBox2.Text = ""; this.materialTextBox2.TrailingIcon = null; + this.materialTextBox2.LeadingIconClick += new System.EventHandler(this.materialTextBox2_LeadingIconClick); // // materialTextBox1 // @@ -2609,7 +2641,6 @@ private void InitializeComponent() this.materialListBox1.Name = "materialListBox1"; this.materialListBox1.SelectedIndex = -1; this.materialListBox1.SelectedItem = null; - this.materialListBox1.SelectedValue = null; this.materialListBox1.Size = new System.Drawing.Size(200, 160); this.materialListBox1.TabIndex = 0; // @@ -2978,5 +3009,7 @@ private void InitializeComponent() private MaterialExpansionPanel materialExpansionPanel2; private MaterialLabel materialLabel51; private MaterialSwitch materialSwitch9; + private MaterialListBox materialListBoxFormStyle; + private MaterialLabel materialLabel52; } } From f015454851d790e3e4cddee4b6dd86726c3be2f8 Mon Sep 17 00:00:00 2001 From: orapps44 <77468294+orapps44@users.noreply.github.com> Date: Sun, 6 Jun 2021 23:05:12 +0200 Subject: [PATCH 4/5] Update MaterialDrawer.cs --- MaterialSkin/Controls/MaterialDrawer.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MaterialSkin/Controls/MaterialDrawer.cs b/MaterialSkin/Controls/MaterialDrawer.cs index 9e6fbe39..fb54a103 100644 --- a/MaterialSkin/Controls/MaterialDrawer.cs +++ b/MaterialSkin/Controls/MaterialDrawer.cs @@ -610,6 +610,20 @@ protected override void OnMouseClick(MouseEventArgs e) _animationSource = e.Location; } + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + if (DesignMode) + return; + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + if (DesignMode) + return; + } + protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); From 4178a1828fce35c7b61a2db8b63d8bd96f7511bc Mon Sep 17 00:00:00 2001 From: orapps44 <77468294+orapps44@users.noreply.github.com> Date: Sun, 6 Jun 2021 23:19:07 +0200 Subject: [PATCH 5/5] Update MaterialDrawer.cs --- MaterialSkin/Controls/MaterialDrawer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MaterialSkin/Controls/MaterialDrawer.cs b/MaterialSkin/Controls/MaterialDrawer.cs index fb54a103..d41c63c7 100644 --- a/MaterialSkin/Controls/MaterialDrawer.cs +++ b/MaterialSkin/Controls/MaterialDrawer.cs @@ -641,7 +641,7 @@ protected override void OnMouseMove(MouseEventArgs e) return; } } - Cursor = Cursors.Arrow; + //Cursor = Cursors.Arrow; } protected override void OnMouseEnter(EventArgs e)