Esempio n. 1
0
 private void Tb_Page_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         string content = tb_Page.Text.Trim();
         int    page    = 1;
         if (content.Length == 0)
         {
             page = 1;
         }
         else
         {
             page = Convert.ToInt32(content);
             if (page < 1)
             {
                 page = 1;
             }
             else if (page > PageCount)
             {
                 page = PageCount;
             }
         }
         CurrentPage = page;
     }
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }
Esempio n. 2
0
 private void Tb_IpAddress_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter || e.KeyChar == 46)
     {
         return;
     }
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }
 private void Tb_NewPassword_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         tb_ConfirmPassword.Focus();
     }
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }
 private void Tb_ConfirmPassword_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         Btn_Enter_Click(null, null);
     }
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }
Esempio n. 5
0
 /// <summary>
 /// 旧密码用户按下并且释放
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Tb_OldPwd_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         if (btn_Enter.Enabled)
         {
             Btn_Enter_Click(null, null);
         }
     }
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }
Esempio n. 6
0
 private void TxtKeyPress(object sendr, KeyPressEventArgs e)
 {
     e.Handled = LimitInput.InputNumber(e.KeyChar);
 }