MyMessageBox show activate

This commit is contained in:
Jaex 2015-09-27 01:14:47 +03:00
parent 6ad54ee766
commit 9a4a64e10f

View file

@ -53,6 +53,8 @@ public MyMessageBox(string text, string caption, MessageBoxButtons buttons = Mes
MinimizeBox = false;
MaximizeBox = false;
Shown += MyMessageBox_Shown;
Label labelText = new Label();
labelText.Margin = new Padding(0);
labelText.Font = SystemFonts.MessageBoxFont;
@ -148,6 +150,11 @@ public MyMessageBox(string text, string caption, MessageBoxButtons buttons = Mes
ClientSize = new Size(panel.Width, labelPanel.Height + (LabelVerticalPadding * 2) + panel.Height);
}
private void MyMessageBox_Shown(object sender, System.EventArgs e)
{
this.ShowActivate();
}
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons = MessageBoxButtons.OK)
{
using (MyMessageBox messageBox = new MyMessageBox(text, caption, buttons))