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 8109943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:34:49+00:00 2026-06-06T01:34:49+00:00

I have a button click event handler with a switch case in it that

  • 0

I have a button click event handler with a switch case in it that controls multiple buttons in one event handler.

I need to use a queue because while one button is clicked and doing some processing, second button click won’t interfere with the first button click, but added to the queue. I don’t want to use .enabled=false; because it’ll discard the second click completely, and I’m currently editing someone’s software at work so I don’t want to break things that I don’t know, so what are you suggesting?

  • 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-06-06T01:34:50+00:00Added an answer on June 6, 2026 at 1:34 am

    I did succeed this with System.Collections.Queue

    The code is :

    private Queue<Button> Button_Queue = new Queue<Button>();
    private bool isProcessing = false;
    
    private void Button_Click((object sender, EventArgs e){
    
    if(isProcessing){
        Button_Queue.Enqueue(this);
    }
    else
    {
        isProcessing = true;
    
        // code here
    
        isProcessing = false;
        while(Button_Queue.Count > 0){
            Button_Queue.Dequeue().PerformClick();
        }
    }
    

    of course mine is slightly different from this because I need to pass some variables and my click method is modified for this.

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

Sidebar

Related Questions

I have a button click event that takes information from controls and enters it
I have a user control that has button whose click event handler contains the
I have a local thread that is started on button-click event from the main
I have an asp.net control, which seems to fire the button click event handler
I have a method set to the click event handler in several Buttons and
I have a button click event handler which says this.Close() In the FormClosing event
I have a button click event handler with the following pseudo code: private void
i have button click handler event in which i am using if-else condition.How can
I have MainWindow with a button, under the button click event I want MainWindow
I have a fairly simple code, a button click event, with the first line

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.