예제 #1
0
        private void clickMe(object sender,EventArgs e,int index,Panel p, myPictureBox one, myPictureBox two)
        {
            one.BackColor = System.Drawing.Color.Transparent;
            two.BackColor = System.Drawing.Color.Transparent;
            //index là chỉ số của form tương ứng
            Form f = new Form();
            switch(index)
            {
                case 1:
                    f = new View.Account.layoutAccountInfor(userId);
                    f.TopLevel = false;
                    f.Dock = DockStyle.Fill;
                    break;
                case 2:
                    f = new View.Account.layoutAccountEdit(userId);
                    f.TopLevel = false;
                    f.Dock = DockStyle.Fill;
                    break;
                case 3:
                    f = new View.Account.layoutAccountChangePass(userId);
                    f.TopLevel = false;
                    f.Dock = DockStyle.Fill;
                    break;
            }
            updateP();
            active = true;
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(107)))), ((int)(((byte)(108)))));

            if (p.Controls.Count != 0)
            {
                p.Controls[0].Dispose();
            }

            p.Controls.Add(f);
            f.Show();
        }
예제 #2
0
        private void clickMeStatistic(object sender, EventArgs e, int index, Panel p, myPictureBox one)
        {
            one.BackColor = System.Drawing.Color.Transparent;
            //index là chỉ số của form tương ứng
            Form f = new Form();
            switch (index)
            {
                case 1:
                    f = new View.Statistic.layoutStatisticStudent();
                    f.TopLevel = false;
                    f.Dock = DockStyle.Fill;
                    break;
                case 2:
                    f = new View.Statistic.layoutStatisticPoint();
                    f.TopLevel = false;
                    f.Dock = DockStyle.Fill;
                    break;
            }
            updateP();
            active = true;
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(107)))), ((int)(((byte)(108)))));

            if (p.Controls.Count != 0)
            {
                p.Controls[0].Dispose();
            }

            p.Controls.Add(f);
            f.Show();
        }
예제 #3
0
 public void setClickStatistic(int index, Panel containContent, myPictureBox one)
 {
     this.Click += (sender, e) => clickMeStatistic(sender, e, index, containContent, one);
 }
예제 #4
0
 public void setClickAccount(int index, Panel containContent, myPictureBox one, myPictureBox two)
 {
     this.Click += (sender, e) => clickMe(sender, e,index, containContent,one,two);
 }