private void login_btn_Click(object sender, EventArgs e) { if (!ID_Box.Text.Equals("") && !PW_Box.Text.Equals("")) { string loginResult = loginReceive.loginReveiveToServer("userLogin", ID_Box.Text, PW_Box.Text); if (loginResult.Equals("true")) { loginStausLabel.Text = ""; UserInfo.userId = ID_Box.Text; UserIP = UserGetIP.GetLocalIP(); UserInfo.userIP = UserIP; contextmenustripform.IconVisiblefalse(); loginformCheck = false; Mainform mainform = new Mainform(contextmenustripform); mainform.Show(); ID_Box.Clear(); PW_Box.Clear(); ID_Box.Focus(); this.Hide(); //서버로 로그인 id에 맞는 값을 받아와야 함. } else { //MessageBox.Show("ID 혹은 PW가 일치하지 않습니다.", "로그인실패", MessageBoxButtons.OK, MessageBoxIcon.Error); loginStausLabel.Text = "ID 또는 PW가 일치하지 않습니다."; loginStausLabel.ForeColor = Color.Red; ID_Box.Clear(); //PW_Box.Clear(); PW_Box.Text = "Password"; PW_Box.ForeColor = Color.Gray; PW_Box.PasswordChar = '\0'; login_btn.BackColor = Color.White; login_btn.ForeColor = Color.Gray; login_btn.Enabled = false; ID_Box.Focus(); } } else { loginStausLabel.Text = "ID 또는 PW를 적어주세요."; loginStausLabel.ForeColor = Color.Red; ID_Box.Focus(); //MessageBox.Show("ID 혹은 PW를 적어주세요.", "로그인실패", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ID_Box_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (!PW_Box.Text.Equals("") && !(PW_Box.Text.Equals("Password") && PW_Box.ForeColor == Color.Gray)) { string loginCheck = loginReceive.loginReveiveToServer("userLogin", ID_Box.Text, PW_Box.Text); if (loginCheck.Equals("true")) { loginStausLabel.Text = ""; UserInfo.userId = ID_Box.Text; UserIP = UserGetIP.GetLocalIP(); UserInfo.userIP = UserIP; contextmenustripform.IconVisiblefalse(); loginformCheck = false; Mainform mainform = new Mainform(contextmenustripform); mainform.Show(); ID_Box.Clear(); PW_Box.Clear(); ID_Box.Focus(); this.Hide(); } else { loginStausLabel.Text = "ID 또는 PW가 일치하지 않습니다."; loginStausLabel.ForeColor = Color.Red; ID_Box.Clear(); //PW_Box.Clear(); PW_Box.Text = "Password"; PW_Box.ForeColor = Color.Gray; PW_Box.PasswordChar = '\0'; login_btn.BackColor = Color.White; login_btn.ForeColor = Color.Gray; login_btn.Enabled = false; ID_Box.Focus(); } } else { PW_Box.Focus(); } } }
public Chat_Form(Mainform m, string s) { InitializeComponent(); textMessage.Focus(); // 포커스 //chatBox.SelectionStart = chatBox.Text.Length;//맨아래고정 //chatBox.ScrollToCaret();//스크롤 만들기 c_mainform = m; string chatname = s; this.Text = chatname; toolTip.AutoPopDelay = 5000; toolTip.InitialDelay = 100; toolTip.ReshowDelay = 500; toolTip.ShowAlways = true; //toolTip.IsBalloon = true; toolTip.SetToolTip(this.Re_Folder, "공유폴더 열기"); contextMenuStripForm = c_mainform.contextMenuStripForm; contextMenuStripForm.chatform = this; contextMenuStripForm.IconVisibletrue(); }
private void logoutToolStripMenuItem_MouseUp(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: if (StandByLogin.sbloginformCheck == true) { LockIconVisiblefalse(); StandByLogin.sbloginformCheck = false; Mainform.mainformCheck = false; standbyLogin.Dispose(); Login.loginformCheck = true; login.Show(); IconVisibletrue(); } else if (Mainform.mainformCheck == true) { Mainform.mainformCheck = false; StandByLogin.sbloginformCheck = false; Login.loginformCheck = true; login.Show(); } else if (enterRoomCheck.enterRoomformCheck == true) { IconVisiblefalse(); enterRoomCheck.enterRoomformCheck = false; mainform.Dispose(); enterRoomcheck.Dispose(); Login.loginformCheck = true; login.Show(); IconVisibletrue(); } else if (Chat_Form.ChatFormCheck == true) { IconVisiblefalse(); if (chatform.m_Client != null) { chatform.m_Client.Close(); } Chat_Form.ChatFormCheck = false; chatform.Dispose(); Login.loginformCheck = true; login.Show(); IconVisibletrue(); } else if (CreateRoom_Form.createRoomCheck == true) { IconVisiblefalse(); CreateRoom_Form.createRoomCheck = false; createroom.Dispose(); Login.loginformCheck = true; login.Show(); IconVisibletrue(); } else if (UserList_Form.userlistformCheck == true) { IconVisiblefalse(); UserList_Form.userlistformCheck = false; mainform.Dispose(); createroom.Dispose(); userlistform.Dispose(); Login.loginformCheck = true; login.Show(); IconVisibletrue(); } SystemEvents.PowerModeChanged -= powerMode.systemSleepMethod; mainform.Dispose(); mainform = null; standbyLogin = null; break; case MouseButtons.Right: // Right click break; } }
public powerMode(Mainform m) { mainform = m; ContextMenuStripForm = mainform.contextMenuStripForm; }