-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmMain.cs
84 lines (66 loc) · 2.41 KB
/
frmMain.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
using System.Drawing;
using System.Windows.Forms;
namespace BookShopManager
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private Form currentFormChild;
/// <summary>
/// Tao form con
/// </summary>
/// <param name="childForm"></param>
private void OpenChildForm(Form childForm)
{
if (currentFormChild != null)
currentFormChild.Close();
currentFormChild = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
pMain.Controls.Add(childForm);
pMain.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}
private Color ColorMain = Color.FromArgb(152, 94, 255);
private Color ColorSecond = Color.FromArgb(219, 178, 255);
private void btnHome_Click(object sender, System.EventArgs e)
{
OpenChildForm(new frmHome());
}
private void frmMain_Load(object sender, System.EventArgs e)
{
OpenChildForm(new frmHome());
}
private void btnLogout_Click(object sender, System.EventArgs e)
{
frmLogin obj = new frmLogin();
obj.Show();
this.Hide();
}
private void btnUser_Click(object sender, System.EventArgs e) => OpenChildForm(new frmMainAcc());
private void btnDashboard_Click(object sender, System.EventArgs e) => OpenChildForm(new frmDashboard());
private void btnInfo_Click(object sender, System.EventArgs e) => OpenChildForm(new frmInfo());
private void btnBooks_Click(object sender, System.EventArgs e)
{
OpenChildForm(new frmBooks());
//OpenChildForm(new frmMainBooks());
}
private void btnExit_Click(object sender, System.EventArgs e) => Application.Exit();
private void btnHistory_Click(object sender, System.EventArgs e)
{
OpenChildForm(new frmMainBill());
}
private void btnExit_Click_1(object sender, System.EventArgs e) => Application.Exit();
private void pictureBox1_Click(object sender, System.EventArgs e)
{
}
private void pMain_Paint(object sender, PaintEventArgs e)
{
}
}
}