I have a DomainUpDown
window. I need to read the value from DomainUpDown
window and next check this in my if()
. For example I give the code:
How to do it properly?
string a;
if(DomainUpDown.Text == "Text1")
{
a="0";
}
else
{
a="1";
}
I have a DomainUpDown
window. I need to read the value from DomainUpDown
window and next check this in my if()
. For example I give the code:
How to do it properly?
string a;
if(DomainUpDown.Text == "Text1")
{
a="0";
}
else
{
a="1";
}
You can shorten it to this (I suppose your number should be an integer):
int myNumber = DomainUpDown.Text == "Text1" ? 0 : 1;