ARTICLE AD BOX
Why is my program returning "Code is invalid" when i have set entered a valid code and have set my form1 background to Color.Green?
private void checkNumber_Click(object sender, EventArgs e) { string userInput = correctNumber.Text; if (userInput == Form1.num && BackColor == Color.Green) { MessageBox.Show("Code is valid"); } else { MessageBox.Show("Code is invalid"); } }221k43 gold badges249 silver badges340 bronze badges
New contributor
dawix is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
7
