I'm working on a program that takes several inputs, does some calculations and then plots a graph. The inputs are handled with a KeyPress event. All of the textBoxes are in a groupBox control. Everything was working fine until I decided to put the optional inputs on a separate tabControl with two tabPages. In the process I did some cutting and pasting of the groupBox with the original textBoxes. Cut some of the textBoxes out of the original groupBox and pasted them in a new groupBox on the new tabControl. I also
created a new textBox and places it on the tabControl.
Now the original textBoxes will not accept any input and only beep when I press Return. The only textBox that accepts input now is the new textBox on the tabControl that was created new (not cut and pasted).
I created a small program with a tabControl and two textBoxes, one on the tabControl. It worked fine, so I suspect that the cutting and pasting I did may have tangled something up. I have tried debugging by stepping into the code, but it never gets to the Keypress event, I just get a beep.
Here's how the KeyPress events are handled:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
char c = e.KeyChar;
int i = (int)c;
if (i == 13) // The "Return/Enter" key was pressed
e.Handled = true;
if (textBox1.Text != "")
inputOD = System.Convert.ToDouble(textBox1.Text);
this.ActiveControl = textBox2;
MessageBox.Show("Nothing was entered!", "Entry Error");