private void button5_Click(object sender, EventArgs e) { frmMsg msg = new frmMsg(); msg.msgInfo = "身份证号码输入错误,电话号码也错误,你他妈的全都是错误,你还有脸了!"; msg.ShowDialog(); }
private void pd1_Click(object sender, EventArgs e) { PictureBox pb = sender as PictureBox; string No = pb.Name.Substring(2, 1); if (No == "f") { if (InputPwd != ExitPwd) { InputPwd = ""; frmMsg frm = new frmMsg(); frm.msgInfo = "退出密码不正确!"; frm.ShowDialog(); } else { if (Exit != null) { Exit(); } } } else { InputPwd += No; } }
private void pb1_Click(object sender, EventArgs e) { if (clickAction != null) { clickAction(); } PictureBox pb = sender as PictureBox; string No = pb.Name.Substring(2, 1); if (No == "b") { if (txtCard.Text.Length > 0 && txtCard.Text.Length <= 18) { txtCard.Text = txtCard.Text.Substring(0, txtCard.Text.Length - 1); txtCard.SelectionStart = txtCard.Text.Length; } } else if (No == "f") { //完成 if (txtCard.Text.Length != 18) { frmMsg frm = new frmMsg();//提示 frm.msgInfo = "身份证号码格式不正确!"; frm.ShowDialog(); return; } else { try { var CardIdentity = new CardIdentity(txtCard.Text); } catch { frmMsg frm = new frmMsg();//提示 frm.msgInfo = "请输入有效的身份证号码!!"; frm.ShowDialog(); return; } CardId = txtCard.Text; if (ProcessIdCard != null) { ProcessIdCard(CardId); } } } else { if (txtCard.Text.Length < 18) { txtCard.Text = txtCard.Text + No; txtCard.SelectionStart = txtCard.Text.Length; } } }
private void pb_Click(object sender, EventArgs e) { if (clickAction != null) { clickAction(); } ucInput pb = sender as ucInput; string No = pb.Name.Substring(2, 1); if (No == "b") { if (txtCard.Text.Length > 0 && txtCard.Text.Length <= 18) { int cle = txtCard.SelectionStart; if (cle < 1) { return; } if (cle == txtCard.Text.Length) { txtCard.Text = txtCard.Text.Substring(0, txtCard.Text.Length - 1); } else { txtCard.Text = txtCard.Text.Substring(0, cle - 1) + txtCard.Text.Substring(cle, txtCard.Text.Length - cle); } txtCard.SelectionStart = cle - 1; } } else if (No == "f") { //完成 if (txtCard.Text.Length != 18) { frmMsg frm = new frmMsg();//提示 frm.msgInfo = "身份证号码格式不正确!"; frm.ShowDialog(); return; } else { try { var CardIdentity = new CardIdentity(txtCard.Text); } catch { frmMsg frm = new frmMsg();//提示 frm.msgInfo = "请输入有效的身份证号码!!"; frm.ShowDialog(); return; } CardId = txtCard.Text; if (ProcessIdCard != null) { ProcessIdCard(CardId); } } } else { if (No == "I") { return; } if (txtCard.Text.Length < 18) { var selection = txtCard.SelectionStart; var up = txtCard.Text.Substring(0, txtCard.SelectionStart); var dowm = txtCard.Text.Substring(txtCard.SelectionStart, txtCard.Text.Length - txtCard.SelectionStart); txtCard.Text = up + No + dowm; txtCard.SelectionStart = selection + 1; } } }