When there is no text entered in any of TextBoxes, I want a new form to open with a message in it
if (rectangleBox.Checked == true && (int.Parse(side_a.Text) > 0 &&
int.Parse(side_b.Text) > 0))
{
var drawRectangle = new Rectangles(70 + int.Parse(side_a.Text),
80 + int.Parse(side_b.Text),
50 + int.Parse(side_a.Text), 70 + int.Parse(side_b.Text));
Figures.Add(drawRectangle);
};
if (string.IsNullOrWhiteSpace(side_a.Text) &&
string.IsNullOrWhiteSpace(side_b.Text) &&
string.IsNullOrWhiteSpace(side_c.Text))
{
Form1 form1 = new Form1();
Form1.ShowDialog();
}
But I get an error on the following lines
if (rectangleBox.Checked == true && (int.Parse(side_a.Text) > 0 &&
int.Parse(side_b.Text) > 0))
"System.FormatException: 'Input string was not in a correct format.'"