📄 tushubianmaruku.cs
字号:
{
if (!(((e.KeyChar >= '0') && (e.KeyChar <= '9')) || e.KeyChar <= 31))
{
if (e.KeyChar == '.')
{
if (((TextBox)sender).Text.Trim().IndexOf('.') > -1)
e.Handled = true;
}
else
e.Handled = true;
}
else
{
if (e.KeyChar <= 31)
{
e.Handled = false;
}
else if (((TextBox)sender).Text.Trim().IndexOf('.') > -1)
{
if (((TextBox)sender).Text.Trim().Substring(((TextBox)sender).Text.Trim().IndexOf('.') + 1).Length >= 2)
e.Handled = true;
}
}
if (e.KeyChar == 13)
{
if (textBjg.Text == "")
{
MessageBox.Show("图书价格不能为空,请输入图书价格!!", "提示");
textBjg.Focus();
}
else
{
textBjg.Enabled = false;
// textBkcsh.Enabled = true;
textBkcsh.Text = "0";
//textBkcsh.Focus();
textBgrsh.Enabled = true;
textBgrsh.Focus();
}
}
}
private void textBkcsh_KeyPress(object sender, KeyPressEventArgs e)
{
//if (e.KeyChar == 13)
//{
// if (textBkcsh.Text == "")
// {
// MessageBox.Show("图书库存数不能为空,请输入图书库存数!!", "提示");
// textBkcsh.Focus();
// }
// else
// {
// textBkcsh.Enabled = false;
// textBgrsh.Enabled = true;
// textBgrsh.Focus();
// }
//}
}
private void textBflh_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBflh.Text = "";
textBflh.Enabled = false;
textBbh.Enabled = true;
textBbh.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBflh.Text == "")
{
MessageBox.Show("图书分类号不能为空,请输入图书分类号!!", "提示");
textBflh.Focus();
}
else
{
textBflh.Enabled = false;
textBshm.Enabled = true;
textBshm.Focus();
}
}
}
private void textBshm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBshm.Text = "";
textBshm.Enabled = false;
textBflh.Enabled = true;
textBflh.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBshm.Text == "")
{
MessageBox.Show("图书书名不能为空,请输入图书书名!!", "提示");
textBshm.Focus();
}
else
{
textBshm.Enabled = false;
textBlb.Enabled = true;
textBlb.Focus();
}
}
}
private void textBlb_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBlb.Text = "";
textBlb.Enabled = false;
textBshm.Enabled = true;
textBshm.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBlb.Text == "")
{
MessageBox.Show("图书类别不能为空,请输入图书类别!!", "提示");
textBlb.Focus();
}
else
{
textBlb.Enabled = false;
textBzzh.Enabled = true;
textBzzh.Focus();
}
}
}
private void textBzzh_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBzzh.Text = "";
textBzzh.Enabled = false;
textBlb.Enabled = true;
textBlb.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBzzh.Text == "")
{
MessageBox.Show("图书作者不能为空,请输入图书作者!!", "提示");
textBzzh.Focus();
}
else
{
textBzzh.Enabled = false;
textBchbsh.Enabled = true;
textBchbsh.Focus();
}
}
}
private void textBchbsh_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBchbsh.Text = "";
textBchbsh.Enabled = false;
textBzzh.Enabled = true;
textBzzh.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBchbsh.Text == "")
{
MessageBox.Show("图书出版社不能为空,请输入图书出版社!!", "提示");
textBchbsh.Focus();
}
else
{
textBchbsh.Enabled = false;
textBbc.Enabled = true;
textBbc.Focus();
}
}
}
private void textBbc_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBbc.Text = "";
textBbc.Enabled = false;
textBchbsh.Enabled = true;
textBchbsh.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBbc.Text == "")
{
MessageBox.Show("图书版次不能为空,请输入图书版次!!", "提示");
textBbc.Focus();
}
else
{
textBbc.Enabled = false;
textBkb.Enabled = true;
textBkb.Focus();
}
}
}
private void textBkb_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBkb.Text = "";
textBkb.Enabled = false;
textBbc.Enabled = true;
textBbc.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBkb.Text == "")
{
MessageBox.Show("图书开本不能为空,请输入图书开本!!", "提示");
textBkb.Focus();
}
else
{
textBkb.Enabled = false;
textBzsh.Enabled = true;
textBzsh.Focus();
}
}
}
private void textBzsh_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBzsh.Text = "";
textBzsh.Enabled = false;
textBkb.Enabled = true;
textBkb.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBzsh.Text == "")
{
MessageBox.Show("图书字数不能为空,请输入图书字数!!", "提示");
textBzsh.Focus();
}
else
{
textBzsh.Enabled = false;
textBjg.Enabled = true;
textBjg.Focus();
}
}
}
private void textBjg_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up")
{
textBjg.Text = "";
textBjg.Enabled = false;
textBzsh.Enabled = true;
textBzsh.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBjg.Text == "")
{
MessageBox.Show("图书价格不能为空,请输入图书价格!!", "提示");
textBjg.Focus();
}
else
{
textBjg.Enabled = false;
// textBkcsh.Enabled = true;
textBkcsh.Text = "0";
//textBkcsh.Focus();
textBgrsh.Enabled = true;
textBgrsh.Focus();
}
}
}
private void textBgrsh_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.ToString() == "Up"&&old==false)
{
textBgrsh.Text = "";
textBgrsh.Enabled = false;
textBjg.Enabled = true;
textBjg.Focus();
}
if (e.KeyCode.ToString() == "Down")
{
if (textBgrsh.Text == "")
{
MessageBox.Show("图书购入数不能为空,请输入图书购入数!!", "提示");
textBgrsh.Focus();
}
else
{
textBgrsh.Enabled = false;
buttbc.Enabled = true;
buttbc.Focus();
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -