From afde63c2859eb2abeea237e301a642ad50201bf0 Mon Sep 17 00:00:00 2001 From: DefKorns Date: Thu, 10 Sep 2020 10:55:50 +0000 Subject: [PATCH] minor tweaks --- MsgBox.cs | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/MsgBox.cs b/MsgBox.cs index e1d45c0..3d6cd78 100644 --- a/MsgBox.cs +++ b/MsgBox.cs @@ -34,7 +34,7 @@ public MsgBox() BackColor = Color.FromArgb(39, 41, 45); StartPosition = FormStartPosition.CenterScreen; Padding = new Padding(3); - Width = 400; + //Width = 400; Icon = (Icon)resources.GetObject("$this.Icon"); @@ -63,9 +63,9 @@ public MsgBox() _plHeader.Controls.Add(_lblTitle); _plFooter.Dock = DockStyle.Bottom; - _plFooter.Padding = new Padding(20); + _plFooter.Padding = new Padding(10); _plFooter.BackColor = Color.Transparent; - _plFooter.Height = 80; + _plFooter.Height = 60; _plFooter.Controls.Add(_flpButtons); _picIcon.Width = 38; @@ -174,12 +174,21 @@ public static DialogResult Show(string message, string title, ButtonType buttons break; case AnimateStyle.FadeIn: + _msgBox.AutoSize = true; + _msgBox.AutoSizeMode = AutoSizeMode.GrowOnly; _msgBox.Size = formSize; _msgBox.Opacity = 0; _timer.Interval = 20; _timer.Tag = new AnimateMsgBox(formSize, style); break; + case AnimateStyle.FadeInHelp: + _msgBox.Size = new Size(500, 360); + _msgBox.Opacity = 0; + _timer.Interval = 20; + _timer.Tag = new AnimateMsgBox(formSize, style); + break; + case AnimateStyle.ZoomIn: _msgBox.Size = new Size(formSize.Width + 100, formSize.Height + 100); _timer.Tag = new AnimateMsgBox(formSize, style); @@ -227,6 +236,18 @@ static void Timer_Tick(object sender, EventArgs e) _timer.Dispose(); } break; + case AnimateStyle.FadeInHelp: + if (_msgBox.Opacity < 1) + { + _msgBox.Opacity += 0.1; + _msgBox.Invalidate(); + } + else + { + _timer.Stop(); + _timer.Dispose(); + } + break; case AnimateStyle.ZoomIn: if (_msgBox.Width > animate.FormSize.Width) @@ -561,7 +582,8 @@ public enum AnimateStyle { SlideDown = 1, FadeIn = 2, - ZoomIn = 3 + ZoomIn = 3, + FadeInHelp = 4 } }