-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDarkMessageBox.cs
54 lines (46 loc) · 1.37 KB
/
DarkMessageBox.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System.Drawing;
using System.Windows.Forms;
public class DarkMessageBox : Form
{
private Label lblMessage;
private Button btnOk;
public DarkMessageBox(string message, string title)
{
Text = title;
Size = new Size(300, 130);
StartPosition = FormStartPosition.CenterScreen;
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
lblMessage = new Label
{
Text = message,
ForeColor = Color.White,
BackColor = Color.Transparent,
AutoSize = false,
Dock = DockStyle.Fill,
TextAlign = ContentAlignment.MiddleCenter
};
btnOk = new Button
{
Text = "Accept",
Dock = DockStyle.Bottom,
ForeColor = Color.White,
BackColor = Color.FromArgb(69, 73, 74),
FlatStyle = FlatStyle.Flat,
DialogResult = DialogResult.OK
};
btnOk.FlatAppearance.BorderSize = 0;
Controls.Add(lblMessage);
Controls.Add(btnOk);
// Aplicar Dark Mode
new BlueMystic.DarkModeCS(this, true, true);
}
public static DialogResult Show(string message, string title)
{
using (var msgBox = new DarkMessageBox(message, title))
{
return msgBox.ShowDialog();
}
}
}