Variable = Expression;The variable can be a declared variable or a control property value. The expression could be a mathematical expression, a number, a string, a Boolean value (
true
or false
), etc.
The following are some examples:
userpass.Text = password; command1.Visible = false; thirdNumber = int.Parse( usernum1.Text );It is a good programming practice to initialize variables properly, otherwise sometimes program may produce unexpected result. The following example uses various types of variables: