Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DefKorns committed Sep 10, 2020
1 parent df7d86e commit afde63c
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions MsgBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -561,7 +582,8 @@ public enum AnimateStyle
{
SlideDown = 1,
FadeIn = 2,
ZoomIn = 3
ZoomIn = 3,
FadeInHelp = 4
}

}
Expand Down

0 comments on commit afde63c

Please sign in to comment.