Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Form1_Load(object sender, EventArgs e) {
- dataGridView1_Konfiguration();
- //txtPerson => ID texteditor
- txtPerson.Focus();
- txtPerson.SelectionStart = txtPerson.Text.Length;
- }
- private void txtPerson_KeyPress(object sender, KeyPressEventArgs e){
- if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)){
- e.Handled = true;
- }
- }
- private void txtPerson_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter && txtPerson.Text == ""){
- MessageBox.Show("Bitte geben ein gültige Personalnummer !!");
- }
- else if (e.KeyCode == Keys.Enter && txtPerson.Text != ""){
- dataGridView1.Enabled = true;
- dataGridView1.Focus();
- dataGridView1.Rows[0].Cells[1].Selected = true;
- }
- }
- e.SuppressKeyPress = true;
- private void txtPerson_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter && txtPerson.Text == "")
- {
- MessageBox.Show("Bitte geben ein gültige Personalnummer !!");
- }
- else if (e.KeyCode == Keys.Enter && txtPerson.Text != "")
- {
- dataGridView1.Enabled = true;
- dataGridView1.Focus();
- dataGridView1.Rows[0].Cells[1].Selected = true;
- e.SuppressKeyPress = true;
- }
- }
Add Comment
Please, Sign In to add comment