By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,701 Members | 1,782 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,701 IT Pros & Developers. It's quick & easy.

Mirror TextBox Text

P: 82
Hi guys and gals,
I appreciate any help in advance.
I have two textbox controls and I want to accept input for textbox 1 and textbox 2. However, when user enters text into textbox 1 I would like textbox 2 to mirror the same text as it is typed.
I am sure this is a very simple procedure however it is new to me and I am having trouble finding an answer with search engines. Most result are coming back as text that one can read backwards in a mirror which is not what I am looking for.

Thanks,
Starlight849
Jul 14 '10 #1

✓ answered by Christopher Nigro

Basically:

Expand|Select|Wrap|Line Numbers
  1.  public partial class Form1 : Form
  2.     {
  3.         public Form1()
  4.         {
  5.             InitializeComponent();
  6.             this.textBox1.KeyUp += new KeyEventHandler(textBox1_KeyUp);
  7.         }
  8.  
  9.         void textBox1_KeyUp(object sender, KeyEventArgs e)
  10.         {
  11.             textBox2.Text = textBox1.Text;
  12.         }
  13.     }
  14.  

Share this Question
Share on Google+
1 Reply


Christopher Nigro
P: 53
Basically:

Expand|Select|Wrap|Line Numbers
  1.  public partial class Form1 : Form
  2.     {
  3.         public Form1()
  4.         {
  5.             InitializeComponent();
  6.             this.textBox1.KeyUp += new KeyEventHandler(textBox1_KeyUp);
  7.         }
  8.  
  9.         void textBox1_KeyUp(object sender, KeyEventArgs e)
  10.         {
  11.             textBox2.Text = textBox1.Text;
  12.         }
  13.     }
  14.  
Jul 14 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.