1
Answer

TextBox-Textchanged

Paritosh Ghosh

Paritosh Ghosh

16y
4.6k
1

Hi,

 

I have two text boxes; Textbox1, Textbox2. If user enters a number into textbox1, the calculated result will be displayed in textbox2. If user enters a number into textbox2, the calculated result will be displayed in textbox1. I used textbox _TextChanged event handler.  It is working fine if user clicks the mouse outside the text box. I don't want that.

 

I have also another tow buttons (Next and Calculate) in this page.

 

What the other way I can solve the problem, any help will be appreciated.

Thanks

Paritosh

Answers (1)
0
Jan Montano

Jan Montano

NA 2.6k 0 16y
Use the keyup event so that it would take effect immediately

private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            MessageBox.Show(textBox1.Text);
        }