I have a countdown timer form - in the first form the user enters a countdown time - warning time, end message, etc. There are also two Radio buttons (Max / Min), and depending on the selected value, they will open a new Max or Min form, where the time will actually begin the countdown. It works fine and calculates as I expect. However, if I exit the Max or Min form and try to run again with new moments, I get an error. Code below - pay attention to the comment .ShowDialog (this); there was something that I tried - it allowed me to close and open new forms, but in fact this is not the beginning of the countdown. UpdateLabels is a feature that updates shortcuts.
bool Max = rbMax.Checked; if (Max == true) { //_Max.ShowDialog(this); _Max.Show(); } else //_Min.ShowDialog(this); _Min.Show(); UpdateLabels(); }
I also tried the following, which I read online as a possible solution, but it also did not work.
private void Max_FormClosing(object sender, FormClosingEventArgs e) { this.Hide(); this.Parent = null; }
Can someone help me - I can post the UpdateLabels function if necessary. I am new to C # UI development, so any help would be great. Thanks.
source share