-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainform.cs
131 lines (108 loc) · 3.76 KB
/
Mainform.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Oracle.ManagedDataAccess.Client;
namespace Db_project
{
public partial class Mainform : Form
{
OracleConnection con;
bool sidebarExpand;
public Mainform()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void sidebarTimer_Tick(object sender, EventArgs e)
{
if (sidebarExpand)
{
sidebar.Width -= 10;
if (sidebar.Width <= sidebar.MinimumSize.Width)
{
sidebarExpand = false;
sidebarTimer.Stop();
}
}
else
{
sidebar.Width += 10;
if (sidebar.Width >= sidebar.MaximumSize.Width)
{
sidebarExpand = true;
sidebarTimer.Stop();
}
}
}
private void menuButton_Click(object sender, EventArgs e)
{
sidebarTimer.Start();
}
private void HomeButton_Click(object sender, EventArgs e)
{
// Create an instance of the homematerial form
homematerial homeMaterialForm = new homematerial();
// Set the size and location of homematerial to cover Form1
homeMaterialForm.Size = this.ClientSize;
homeMaterialForm.Location = new Point(0, 0);
// Set homematerial as a child form of Form1
homeMaterialForm.TopLevel = false;
homeMaterialForm.FormBorderStyle = FormBorderStyle.None;
this.Controls.Add(homeMaterialForm);
// Show the homematerial form
homeMaterialForm.Show();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
// Add code for linkLabel1 click event if needed
}
private void button3_Click(object sender, EventArgs e)
{
// Add code for button3 click event if needed
}
private void label1_Click(object sender, EventArgs e)
{
// Add code for label1 click event if needed
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
// Add code for panel1 paint event if needed
}
private void button2_Click(object sender, EventArgs e) //scheduling
{
Scheduling sh = new Scheduling();
sh.Size = this.ClientSize;
sh.Location = new Point(0, 0);
sh.TopLevel = false;
sh.FormBorderStyle = FormBorderStyle.None;
this.Controls.Add(sh);
sh.Show();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void button4_Click(object sender, EventArgs e)// about
{
// Create an instance of the homematerial form
AboutUs aboutus = new AboutUs();
// Set the size and location of homematerial to cover Form1
aboutus.Size = this.ClientSize;
aboutus.Location = new Point(0, 0);
// Set homematerial as a child form of Form1
aboutus.TopLevel = false;
aboutus.FormBorderStyle = FormBorderStyle.None;
this.Controls.Add(aboutus);
// Show the homematerial form
aboutus.Show();
}
}
}