Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Show text textBox1 in textBox2 C#

$
0
0

Hi,

I have a textBox1 and textBox2. I want to make a sort of  encryption program. So, when I typ 'A' in textBox1, I want to show '/' and when I typ B I want to show '['. But here is the problem: the program only works when I typ one character. If I typ AB it won't show '/[', but it shows nothing..

can anyone help me?

Code

private void button1_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text == "A")

                textBox2.Text = "/";

            
            
            if (this.textBox1.Text == "B")

                textBox2.Text = "[";



           
        }


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>