winforms - C# updating textbox text from another textbox -


i trying make program where, there blank text in textbox 2, type text textbox 1 updates , goes textbox 2

so basically, textbox 1 empty, whatever typed in textbox1 updates , goes textbox 2

view images below understand mean.

http://i.stack.imgur.com/2djk6.png http://i.stack.imgur.com/5kpax.png

you don't need ((textbox)sender).text;. try this:

private void textbox1_textchanged(object sender, eventargs e) {      textbox2.text = this.textbox1.text; } 

update: responding newest comment, here's how can replace field values on enter.

if want string.replace when user hits enter, go textbox events, keyup, , add code:

    private void textbox1_keyup(object sender, keyeventargs e)     {         if (e.keycode == keys.enter)         {             this.textbox2.text = this.textbox1.text.replace("whatever", "something else");         }     } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -