Exemple #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            //=======================================================================================================
            user1     = new BOOK_INFO_FORM(this);
            login_frm = new LOGIN_FORM(this);
            Login     = new LOGIN_FORM(this);
            Signup    = new SIGNUP_FORM(this);
            //=======================================================================================================

            ClientSize          = new Size(sX, sY); // 폼 사이즈 지정.
            this.IsMdiContainer = true;             // MDI 설정.

            //좌표 체크시 추가
            //Point_Print();

            // 컨트롤 객체생성.
            COMMON_Create_Ctl comm_create_ctl = new COMMON_Create_Ctl();

            // 생성할 패널 정보 객체 생성.
            PANELclass pn1 = new PANELclass(this, "panel1", "panel_main", 1500, 780, 0, 145);

            panel1 = comm_create_ctl.panel(pn1); // ex) 판넬만들기 :  create_ctl.CTL명(CTL값);
            Controls.Add(panel1);                // 원하는 컨트롤에 추가함.

            BTNclass bt1 = new BTNclass(this, "유저1", "도서정보", 285, 145, 0, 0, btn1_Click);
            BTNclass bt2 = new BTNclass(this, "유저2", "대여목록", 285, 145, 285, 0, btn2_Click);
            BTNclass bt3 = new BTNclass(this, "유저3", "나의정보", 285, 145, 570, 0, btn3_Click);
            BTNclass bt4 = new BTNclass(this, "유저4", "위치정보", 285, 145, 855, 0, btn4_Click);

            BTNclass bt6 = new BTNclass(this, "관리2", "회원정보", 285, 145, 285, 0, btn6_Click);
            BTNclass bt7 = new BTNclass(this, "관리3", "도서관리", 285, 145, 570, 0, btn7_Click);
            BTNclass bt8 = new BTNclass(this, "관리4", "연체관리", 285, 145, 855, 0, btn8_Click);

            btn = comm_create_ctl.btn(bt1);
            ButtonConfig(btn, "book_info");
            btn1 = comm_create_ctl.btn(bt2);
            ButtonConfig(btn1, "rental_list");
            btn2 = comm_create_ctl.btn(bt3);
            ButtonConfig(btn2, "my_information");
            btn3 = comm_create_ctl.btn(bt4);
            ButtonConfig(btn3, "book_location");

            btn5 = comm_create_ctl.btn(bt6);
            ButtonConfig(btn5, "user_management");
            btn6 = comm_create_ctl.btn(bt7);
            ButtonConfig(btn6, "book_management");
            btn7 = comm_create_ctl.btn(bt8);
            ButtonConfig(btn7, "overdue_management");


            Controls.Add(btn);

            Controls.Add(btn1);
            Controls.Add(btn2);
            Controls.Add(btn3);


            Controls.Add(btn5);
            Controls.Add(btn6);
            Controls.Add(btn7);

            //MessageBox.Show("login_frm.Member_rank : " + login_frm.Member_rank);

            if (login_frm.Member_rank == 4) // 비회원
            {
                user1.Show();
                btn1.Hide();
                btn2.Hide();
                btn3.Hide();

                btn5.Hide();
                btn6.Hide();
                btn7.Hide();
            }

            //else if (member_rank == 0) //관리자
            //{

            //    btn.Hide();
            //    btn1.Hide();
            //    btn2.Hide();
            //    btn3.Hide();
            //}
            //else if(member_rank == 1) //유저
            //{
            //    user1.Show();
            //    btn4.Hide();
            //    btn5.Hide();
            //    btn6.Hide();
            //    btn7.Hide();
            //}



            //라벨 ==============================================================================================================================================
            ArrayList lbarray = new ArrayList();

            lbarray.Add(new LBclass(this, "Login", "Login   /", 15, 90, 30, 1500 - 190, 10, label_Click));
            lbarray.Add(new LBclass(this, "Signup", "Signup", 15, 90, 30, 1500 - 100, 10, label2_Click));
            lbarray.Add(new LBclass(this, "Logout", "Logout", 15, 90, 30, 1500 - 100, 10, label3_Click));


            for (int i = 0; i < lbarray.Count; i++)
            {
                Label lb = comm_create_ctl.lb((LBclass)lbarray[i]);
                lb.Visible   = true;
                lb.Cursor    = Cursors.Hand;
                lb.Parent    = pictureBox;
                lb.BackColor = Color.FromArgb(201, 253, 223);
                lb.BringToFront();
                lb.ForeColor = Color.FromArgb(39, 174, 97);

                if (lb.Name == "Login")
                {
                    lb.Font = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129)));

                    lb_Login = lb;
                }
                else if (lb.Name == "Signup")
                {
                    lb.Font   = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129)));
                    lb_Signup = lb;
                }
                else if (lb.Name == "Logout")
                {
                    lb.Font   = new Font("견명조", 15F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(129)));
                    lb_Logout = lb;
                }
                Controls.Add(lb);
            }
            lb_Logout.Hide();

            //=====================================================================================================================================================

            Logo_Load();//로고 이미지

            // Set the Parent Form of the Child window.
            //Child1.TopLevel = false;
            //Child1.TopMost = true;
            //Child1.MdiParent = this;
            //Child1.Dock = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            //panel1.Controls.Add(Child1);

            //Child2.Show();
            //Child1.Show();
            //Child1.Dispose();

            //Set the Parent Form of the Child window.

            user1.TopLevel  = false;
            user1.TopMost   = true;
            user1.MdiParent = this;
            user1.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(user1);

            user2.TopLevel  = false;
            user2.TopMost   = true;
            user2.MdiParent = this;
            user2.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(user2);

            user3.TopLevel  = false;
            user3.TopMost   = true;
            user3.MdiParent = this;
            user3.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(user3);

            user4.TopLevel  = false;
            user4.TopMost   = true;
            user4.MdiParent = this;
            user4.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(user4);

            Login.TopLevel  = false;
            Login.TopMost   = true;
            Login.MdiParent = this;
            Login.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(Login);

            Signup.TopLevel  = false;
            Signup.TopMost   = true;
            Signup.MdiParent = this;
            Signup.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(Signup);


            root2.TopLevel  = false;
            root2.TopMost   = true;
            root2.MdiParent = this;
            root2.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(root2);

            root3.TopLevel  = false;
            root3.TopMost   = true;
            root3.MdiParent = this;
            root3.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(root3);

            root4.TopLevel  = false;
            root4.TopMost   = true;
            root4.MdiParent = this;
            root4.Dock      = DockStyle.Fill; //판넬크기에 맞게 사이즈 늘림.
            panel1.Controls.Add(root4);
        }