-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
87 lines (77 loc) · 2.26 KB
/
Form1.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
namespace ModernFlatUI
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
customizeDesign();
}
private void customizeDesign()
{
pnBanHangSubMenu.Visible = false;
pnNhapHangSubMenu.Visible = false;
pnQuanLySubMenu.Visible = false;
}
private void hideSubMenu()
{
if (pnBanHangSubMenu.Visible == true)
pnBanHangSubMenu.Visible = false;
if (pnNhapHangSubMenu.Visible == true)
pnNhapHangSubMenu.Visible = false;
if (pnQuanLySubMenu.Visible == true)
pnQuanLySubMenu.Visible = false;
}
private void showSubMenu(Panel subMenu)
{
if (subMenu.Visible == false)
{
hideSubMenu();
subMenu.Visible = true;
}
else
{
subMenu.Visible = false;
}
}
private void btnBanHang_Click(object sender, EventArgs e)
{
showSubMenu(pnBanHangSubMenu);
}
private void btnNhapHang_Click(object sender, EventArgs e)
{
showSubMenu(pnNhapHangSubMenu);
}
private void btnQuanLy_Click(object sender, EventArgs e)
{
showSubMenu(pnQuanLySubMenu);
}
private Form activeForm = null;
private void openChildForm(Form childForm)
{
if (activeForm != null)
{
activeForm.Close();
}
activeForm = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
pnChildForm.Controls.Add(childForm);
pnChildForm.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}
private void button2_Click(object sender, EventArgs e)
{
openChildForm(new Form2());
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button6_Click(object sender, EventArgs e)
{
openChildForm(new Form3());
}
}
}