I am developing my first UI C# program. I am hoping for some help. My first form contains a few textboxes, and two radio buttons and a Go button. If one radio button is checked it opens a new small form, if the other is checked it opens a new large form.
when the user clicks go – this is my code –
this.WindowState = FormWindowState.Minimized;
int.TryParse(tbHrs.Text, out hours);
int.TryParse(tbMins.Text, out minutes);
int.TryParse(tbSecs.Text, out seconds);
int.TryParse(tbWarn1.Text, out warn1);
int.TryParse(tbWarn2.Text, out warn2);
bool Max = rbMax.Checked;
if (Max == true)
{
if (_Max == null || _Max.IsDisposed)
{
_Max = new Max(hours, minutes, seconds, warn1, warn2);
}
_Max.Show();
}
else
{
if (_Min == null || _Min.IsDisposed)
{
_Min = new Min(hours, minutes, seconds, warn1, warn2);
}
_Min.Show();
}
so it minimizes the form where the values were entered and passes across the values to start counting down when constructing the new form. On the new form I want to have buttons to pause, which work fine. However I also want a stop/reset button. So on stop/reset click i want to close the current form but then I want to bring the first form open from minimize state – i tried the commented out line below but it did not work. Does anyone know of way I can show the first user input form from minimize state when stop close on the second form is clicked and even better if it could reset the fields to blank on my first form. Many Thanks.
private void MinStop_Reset_Click(object sender, EventArgs e)
{
this.Close();
//ParentForm.Show();
}
In the parent form do: