日期:2014-05-18 浏览次数:20850 次
//a 文本框 private void txtTSPName_Enter(object sender, EventArgs e) { if (txtTSPName.Text.Trim() != string.Empty && txtTrayCode.Text.Trim() != string.Empty ) { MessageBox.Show("不能更改承运商编码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (txtGoodCode.Text == string.Empty) txtGoodCode.Focus(); if(txtWeight.Text==string.Empty)txtWeight.Focus(); } } private void txtTSPName_Leave(object sender, EventArgs e) { txtTrayCode.Focus(); } //b文本框 private void txtTrayCode_Enter(object sender, EventArgs e) { if (txtTSPName.Text.Trim() == string.Empty) { MessageBox.Show("请先输入承运商编码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtTSPName.Focus(); } else if (txtTSPName.Text.Trim() != string.Empty && txtTrayCode.Text.Trim() != string.Empty && txtGoodCode.Text.Trim() != string.Empty) { MessageBox.Show("不能更改托盘号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (txtGoodCode.Text == string.Empty) txtGoodCode.Focus(); if (txtWeight.Text == string.Empty) txtWeight.Focus();//txtWeight是d文本框 } } private void txtTrayCode_Leave(object sender, EventArgs e) { if (txtTSPName.Text == string.Empty) { txtTSPName.Focus(); } else { txtGoodCode.Focus(); } } //c 文本框 private void txtGoodCode_Enter(object sender, EventArgs e) { if (txtTSPName.Text.Trim() == string.Empty) { MessageBox.Show("请先输入承运商编码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtTSPName.Focus(); } else if (txtTrayCode.Text.Trim() == string.Empty) { MessageBox.Show("请先扫描托盘号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtTrayCode.Focus(); } } private void txtGoodCode_Leave(object sender, EventArgs e) { txtWeight.Focus(); }