Hi, I have a question.
I am trying to create a form where people will enter some data and all textboxes mainly are the same and only one box is changing. So I created a form and then a button and and when you cklick this button the data is added to the database and the for is not closing.
When the button "save and add new" is cklicked I need that I textBox to be selected so I used function "serial.Focus();" and here comes my problem - everithing looks and works grate, but the problem is that when the program returns the form focusd on the TextBox serial the whole text that is entered in that TextBox is not selected and I need it to be selected.
Can anyone explane me how to make the form to return and be focused on particular TextBox and all text in that textbox to be highligted?
Here is what I have:
private void savenew_Click(object sender, EventArgs e)
{
try
{
this.serialsTableAdapter.InsertSerial(item.Text, serial.Text, datein.Text, dateout.Text, warant.Text, comm.Text, com.Text);
}
catch
{
MessageBox.Show(this, "Error");
return;
}
serial.Focus();
MessageBox.Show("Data has been added to the database");
return;
Thank you