Consider this snippet:
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.MaxLength > 0)
{
textBox2.Text = Convert.ToBoolean(Math.Sqrt(textBox1.MaxLength)).ToString();
}
else if (textBox1.MaxLength < 32768)
{
textBox2.Text = Convert.ToBoolean(Math.Sqrt(textBox1.MaxLength)).ToString();
}
}
Why does this not evaluate the second condition (less than the condition)? This is also true, isn't it?
If I need to get the second to work in the same state, what minor changes should be made?
source
share