You should not get a property textBox1.txt instead textBox1.Text.however
= is assignment operator where in == is for compare equality operator.And use
string.Compare()
to compare string you should not use == to compare string like this
.However below is your
private void button1_Click(object sender, EventArgs e)
{
if (string.Compare(textBox1.Text,"USER")==0 && string.Compare(textBox2.Text,"password123")==0)
{
this.Hide();
Form2 PROJ_FORM1 = new Form2();
PROJ_FORM1.Show();
}
else if (string.Compare(textBox1.Text, "USER") != 0 && string.Compare(textBox2.Text,"password123")==0)
MessageBox.Show("Incorrect User Id");
else if (string.Compare(textBox1.Text, "USER") == 0 && string.Compare(textBox2.Text,"password123")!=0)
MessageBox.Show("Incorrect Password");
else if (string.Compare(textBox1.Text,"USER")!=0 && string.Compare(textBox2.Text,"password123")!=0)
MessageBox.Show("Incorrect User Id and Password");
}