'if' statements
c#, winforms
Solution
if (number == 1)
{
textbox2.Text = "1";
number2 = 33;
textbox3.text = (Convert.ToString(RSP));
}
Add brackets to group statements together.
Without the brackets, the if-statement will ONLY affect the very next statement: `textbox2.Text = "1";`, and the other statements will always be run, regardless of the if-statement.
Problem
Im still new to C# and was wondering how one would have multiple things happen when an if condition is met. for example. ``` int number = (Convert.ToInt32(textbox1.text)); if (number == 1) textbox2.Text = "1"; number2 = 33; textbox3.text = (Convert.ToString(number2)); ``` When I do something like this it dosnt complete all the desired results. P.S If this isnt the right site to go for newbie questions like this does anyone know where I can go? (after research of course).