Beispiel #1
0
        public Drop(MainForm MainMenu)
        {
            this.main = MainMenu;
            InitializeComponent();

            int     w  = this.Width;
            int     h  = this.Height;
            TextBox tb = new TextBox()
            {
                Width = (int)(w * 0.35), Location = new Point((int)(w * 0.25), (int)(h * 0.2)), PasswordChar = '*'
            };

            this.Controls.Add(tb);
            Label lbl = new Label()
            {
                Text = "비밀번호", Location = new Point((int)(w * 0.05), (int)(h * 0.2))
            };

            this.Controls.Add(lbl);
            Button drop = new Button()
            {
                Text = "탈퇴하기", Location = new Point((int)((w * 0.25) + tb.Width + 10), (int)(h * 0.2))
            };

            Design.buttonStyle(drop);
            this.Controls.Add(drop);

            // 탈퇴버튼 이벤트
            drop.Click += (sender, e) =>
            {
                string       mypwd = Store.myInfo.getPwd();
                DialogResult result;
                if (tb.Text == mypwd)
                {
                    result = MessageBox.Show("탈퇴하겠습니까?", "확인", MessageBoxButtons.OKCancel);
                    if (result == DialogResult.OK)
                    {
                        string packet = "3|3|" + Store.myInfo.getUserNum() + "|" + mypwd + "|";
                        MainMenu.SendStr(packet);
                        //MessageBox.Show("탈퇴되었습니다.");
                        // 로그인창으로 돌아가게 만들기
                    }
                }
                else
                {
                    MessageBox.Show("정보가 일치하지 않습니다.");
                }
                //else
                //{
                //    MessageBox.Show("비밀번호가 틀렸습니다.");
                //}
            };
        }
Beispiel #2
0
        public AddChatRoom(MainForm main, menu_chatting menu_chatting)
        {
            this.menu_chatting = menu_chatting;

            InitializeComponent();
            this.main = main;
            foreach (Friend item in friendList)
            {   // 친구목록 출력
                //checkedListBox1.Items.Add(item.getfId() + " : " + item.getfname());
                checkedListBox1.Items.Add(item.getfname());
            }
            Design.buttonStyle(btnAdd);
        }
Beispiel #3
0
        public Login(MainForm form)
        {
            InitializeComponent();

            Design.buttonStyle(btnLogin);
            Design.buttonStyle(btnNewAccount);

            this.form  = form;
            newAccount = new NewAccount(this, form);
            Controls.Add(newAccount);
            txtID.SetHintText("아이디");
            txtPW.SetHintText("비밀번호", true);
        }
Beispiel #4
0
        public ChatRoom(MainForm main, int rNumber, bool isFirst)
        {
            this.rNumber = rNumber;
            InitializeComponent();
            this.main    = main;
            this.isFirst = isFirst;
            Design.buttonStyle(btnFileList);
            Design.buttonStyle(btnFileSend);
            Design.buttonStyle(btnMember);
            //Design.buttonStyle(btnMsgSend);
            btnFileList.Hide();
            btnFileSend.Hide();

            textBox2.KeyPress += (sender, e) =>
            {
                if (textBox2.Text.Length > 300)
                {
                    MessageBox.Show("300자 이상 보낼 수 없습니다.");
                    e.Handled = true;
                }
            };
        }
Beispiel #5
0
        public NewAccount(Login login, MainForm form)
        {
            InitializeComponent();

            Design.buttonStyle(button1);
            Design.buttonStyle(button2);

            this.login = login;
            this.form  = form;
            textBox1.SetHintText("아이디 입력");
            textBox2.SetHintText("비밀번호 입력", true);
            textBox3.SetHintText("비밀번호 확인", true);
            textBox4.SetHintText("닉네임 입력");

            textBox1.TextChanged += (sender, e) =>
            {
                int length = textBox1.Text.Length;
                if (length < 4)
                {
                    isIdOk = false;
                }
                else
                {
                    isIdOk = true;
                }
            };

            textBox1.KeyPress += (sender, e) =>
            {
                char[] noIdAlpha = { ',', '.', '/', '?', '<', '>', ':', ';', '\'', '\"', '{', '[', '}', ']', '|', '\\' };

                for (int i = 0; i < noIdAlpha.Length; i++)
                {
                    if (e.KeyChar == noIdAlpha[i])
                    {
                        e.Handled = true;
                        MessageBox.Show("특수기호는 `, ~, !, @, #, $, %, ^, &, * 만 가능합니다.");
                    }
                }
            };

            textBox2.TextChanged += (sender, e) =>
            {
                string pw   = textBox2.Text;
                bool   isPw = passwordCheck(pw);
                if (isPw)
                {
                    label1.Text      = "비밀번호가 적합합니다.";
                    label1.ForeColor = Color.Green;
                    isPwOk           = true;
                }
                else
                {
                    label1.Text      = "비밀번호가 적합하지 않습니다.";
                    label1.ForeColor = Color.Red;
                    isPwOk           = false;
                }
            };

            textBox2.KeyPress += (sender, e) =>
            {
                char[] noIdAlpha = { ',', '.', '/', '?', '<', '>', ':', ';', '\'', '\"', '{', '[', '}', ']', '|', '\\' };

                for (int i = 0; i < noIdAlpha.Length; i++)
                {
                    if (e.KeyChar == noIdAlpha[i])
                    {
                        e.Handled = true;
                        MessageBox.Show("특수기호는 `, ~, !, @, #, $, %, ^, &, * 만 가능합니다.");
                    }
                }
            };


            textBox3.TextChanged += (sender, e) =>
            {
                if (textBox2.Text != textBox3.Text)
                {
                    label2.Text      = "비밀번호가 동일하지 않습니다.";
                    label2.ForeColor = Color.Red;
                    isPwCheckOk      = false;
                }
                else
                {
                    label2.Text      = "비밀번호가 동일합니다.";
                    label2.ForeColor = Color.Green;
                    isPwCheckOk      = true;
                }
            };
        }
Beispiel #6
0
 public ChangePwd(MainForm main)
 {
     this.main = main;
     InitializeComponent();
     Design.buttonStyle(button1);
 }
Beispiel #7
0
 public menu_chatting(MainForm main)
 {
     InitializeComponent();
     this.main = main;
     Design.buttonStyle(btnAddRoom);
 }