Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6247273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:50:23+00:00 2026-05-24T12:50:23+00:00

I have a countdown Timer form – on the first form the user will

  • 0

I have a countdown Timer form – on the first form the user will enter the countdown time – warning times, end message, etc. There are also two Radio buttons (Max/Min) and depending on which is selected they will open a new Max or Min form where the time will actually start to countdown. It is working fine and counting down as I expect. However, if I exit the Max or Min form and try to run again with new times I get the error. The code is below – note the comment out ShowDialog(this); was something I tried – it let me close and open the new forms ok but it did not actually start the countdown. UpdateLabels is the function that does the updating of Labels.

                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 anyone help me out – I can post the UpdateLabels function if needed. I am pretty new to UI C# development so any help would be great. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:50:25+00:00Added an answer on May 24, 2026 at 12:50 pm

    The problem is, that a closed form can not be used anymore (be reopened). Thats why the code you posted tries to stop closing and only hides your window. But for doing this, the Cancel-property must be set to true:

    private void Max_FormClosing(object sender, FormClosingEventArgs e)    {        
       this.Hide();        
       this.Parent = null;    
       e.Cancel=true;
    }
    

    To show the form after closing it this way, show it with the Show() method.

    However this is probably only a workaround and you could solve the problem with another design.
    Maybe it would be wise, to create a new instance of your form, every time you need it, instead of trying to reopen it every time. This also has the advantage that the form only requesires resources if it is really needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control form for a countdown timer. I want a start
I have a windows form which is a countdown Timer. What is the best
I have created an application.in the app i start a countdown timer and save
I have a control that is basically functioning as a client-side timer countdown control.
I have the following script: Timer=0; function countdown(auctionid){ var auctions; var divs; Timer=Timer+1; if((Timer%10==0)||(Timer==1)){
I have a simple countdown timer that updates a label every second. How do
I am working with a countdown timer and have it set so that it
I have a countdown timer in javascript that is called by a code behind
I have a countdown timer textfield that displays 60 as a placeholder (grey). When
I am using the jquery countdown timer here http://www.littlewebthings.com/projects/countdown/ and I have found that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.