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

  • SEARCH
  • Home
  • 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 7433515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:41:02+00:00 2026-05-29T09:41:02+00:00

My small windows form application has two radio buttons, and initially neither is checked.

  • 0

My small windows form application has two radio buttons, and initially neither is checked. Until one of them is checked, the “Go” button should be disabled.

I found a very simple way to obtain this, but I’m not sure if I’m setting myself up for a random crash.

I added a timer component, enabled it, and in the Tick event:

private void timer1_Tick(object sender, EventArgs e)
{
    bool canGo = (_usRadioButton.Checked || _intlRadioButton.Checked);
    if (_goButton.Enabled != canGo)
    {
        _goButton.Enabled = canGo;
    }
}

I know there are other ways to do this, I’m just curious if this way is valid or if I’m going to have an end user throwing exceptions when the timer is firing at the same time the form is updating the Checked property on one of the checkboxes?

  • 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-29T09:41:03+00:00Added an answer on May 29, 2026 at 9:41 am

    If I understood you correctly, you already know about the CheckedChanged event, and are only asking about conflicts in your code. So:

    As far as I know it’s not multithreading, and there’s no danger. The Tick event will actually not fire at the same time the computer is updating the Checked state.

    If you place traces in Form.Load and Timer.Tick:

    private void Form_Load(object sender, EventArgs e)
    { 
        Console.WriteLine("Form_Load/Thread.CurrentThread.ManagedThreadId=" + Thread.CurrentThread.ManagedThreadId);
    }
    
    private void timer1_Tick(object sender, EventArgs e)
    {
         Console.WriteLine("timer1_Tick/Thread.CurrentThread.ManagedThreadId=" + Thread.CurrentThread.ManagedThreadId);
    }
    

    The results show:

    Form_Load/Thread.CurrentThread.ManagedThreadId=9
    timer1_Tick/Thread.CurrentThread.ManagedThreadId=9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows Form Application in which clicking certain buttons create objects from
I'm making a small Windows Form application that contains a lot of grid views.
I am using Windows Form application. I want to open a small textbox on
I 'am building a small windows form application. I have a View - a
I created my ClickOnce application witch will install a small windows form application that
as I am doing a small chat application in vb.net (windows form), I'm having
I am building a small windows form application in C#. Within the form code
I'm using Windows XP and currently, I'm developing a small win form application so
I have written a small .net Windows Forms application. And now I decided to
I'm developing a small tray-icon application for Windows and I need to display non-intrusive

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.