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

More than one things to do if-statement C#

$
0
0

Hi,

if (this.textBox1.Text == "username" && this.textBox2.Text == "password")

            button10.Enabled = true;
            button3.Enabled = true;
            button4.Enabled = true;
            button5.Enabled = true;
            button6.Enabled = true;
            button7.Enabled = true;
            button8.Enabled = true;

            else

            MessageBox.Show("Error");

VS gives an error by the else-statement ('invalid expression term else'). Simple question: Why? and how do I solve this?

Thanks.



Viewing all articles
Browse latest Browse all 2535

Trending Articles



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