示例#1
0
        public FM_Main()
        {
            InitializeComponent();
            //로그인 폼 호출
            FM_Login Login = new FM_Login();

            Login.ShowDialog();

            tssUserName.Text = Login.Tag.ToString();
            if (Login.Tag.ToString() == "FAIL")//태그가 fail일 때 종료
            {
                Application.ExitThread();
                Application.Exit();
                //  System.Environment.Exit(0);
            }

            //메뉴클릭 이벤트 추가

            this.stbExit.Click  += new System.EventHandler(this.stbExit_Click);
            this.stbClose.Click += new System.EventHandler(this.stbClose_Click);

            this.stbSearch.Click += new System.EventHandler(this.stbSearch_Click);
            this.stbInsert.Click += new System.EventHandler(this.stbInsert_Click);
            this.stbDelete.Click += new System.EventHandler(this.stbDelete_Click);
            this.stbSave.Click   += new System.EventHandler(this.stbSave_Click);
        }
示例#2
0
        public FM_Main()
        {
            InitializeComponent();
            //로그인 폼 호출
            FM_Login Login = new FM_Login();

            Login.ShowDialog();

            tssUserName.Text = Login.Tag.ToString(); // Tag를 배열처럼 사용할 수 없다. 두가지 이상이면 Liter를 사용, 로그인 안하고 창 끄면 에러뜸(Null값이라서인가?)

            //버튼이 클릭 안될때
            #region
            /*  ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ*/
            // 버튼에 이벤트 추가(버튼이 안눌릴 때)
            //this.stbExit.Click += new System.EventHandler(this.stbExit_Click);   만약 디자인에서 클릭이 안될때 이것 추가,
            //                                                                     그리고 private void stbExit_Click(object sender, EventArgs e){} 작성
            //                                                                     만약 클릭이 되면 Main 디자이너에
            //                                                                     this.stbExit.Click += new System.EventHandler(this.stbExit_Click) 생성되있음

            // 메뉴 클릭 이벤트 추가(클릭이 안될 때)
            //this.M_SYSTEM.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.MBI_TEST_DropDownItemClicked); // M_SYSTEM : 메인창의 MenuStrip 이름, 이걸 클릭했을 때 이벤트 발생
            /*  ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ*/
            #endregion

            if (tssUserName.Text == "FAIL")  // USERNAME이 FAIL이면 성립 안함
            {
                //Application.ExitThread();   // 동작하고 있는 모든 쓰레드를 닫아라
                //Application.Exit();

                System.Environment.Exit(0); // 위 코드와 같은 기능임
            }
        }
示例#3
0
        public FM_MAIN()
        {
            InitializeComponent();
            //버튼에 이벤트 추가

            //로그인
            FM_Login Login = new FM_Login();

            Login.ShowDialog();
            tssUserName.Text = Login.Tag.ToString();
            if (Login.Tag.ToString() == "FAIL")
            {
                //  Application.ExitThread();
                //Application.Exit();
                System.Environment.Exit(0);
            }

            ////버튼에 종료 이벤트추가
            this.stbExit.Click += new System.EventHandler(this.stbExit_Click);

            //버튼 닫기이벤트 추가
            this.stbClose.Click += new System.EventHandler(this.stbClose_Click);

            //메뉴클릭이벤트 추가
            this.M_SYSTEM.DropDownItemClicked +=
                new System.Windows.Forms.ToolStripItemClickedEventHandler(this.M_SYSTEM_DropDownItemClicked);

            //버튼 조회 이벤트 추가
            this.stbSearch.Click += new System.EventHandler(this.stbSearch_Click);

            //버튼 추가 이벤트 추가
            this.stbInsert.Click += new System.EventHandler(this.stbInsert_Click);

            //버튼 삭제 이벤트 추가
            this.stbDelete.Click += new System.EventHandler(this.stbDelete_Click);

            //버튼 저장 이벤트 추가
            this.stbSave.Click += new System.EventHandler(this.stbSave_Click);
        }