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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:22:42+00:00 2026-06-10T08:22:42+00:00

I am trying to block the user from clicking a button multiple times while

  • 0

I am trying to block the user from clicking a button multiple times while data is being processed after it was started by the initial click.

Simply disabling the button (buttonBackupNow.Enabled = false;) doesn’t help because if the user clicks the button multiple times even when the button is disabled, the form registers the clicks and restarts data processing as soon as the previous data processing routine.

I tried making the button invisible, still the same result. Tried disabling the form, again, the same result. So I think that the only solution is to completely ignore the clicks while data is being processed.

So, how can I stop a form from receiving user mouse clicks?

EDIT: This issue is related to the fact that I am trying to re-enable the button after data processing is finished.

  • 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-10T08:22:43+00:00Added an answer on June 10, 2026 at 8:22 am

    Simply disabling the button (buttonBackupNow.Enabled = false;) doesn’t
    help because if the user click the button multiple times even when the
    button is disabled, the form registers the clicks and restarts data
    processing as soon as the previous data processing routine finished.

    Really? How have you accomplished that? I wasn’t able to reproduce it at all. Disabling the button stopped the Click event from being triggered.

    This by itself should be enough. You shouldn’t have to disattach the event (as well as using other tricks). If you need resorting to that, something could be not right somewhere else (perhaps some code is re-enabling the button?).

    The fact that even removing the handler doesn’t do the trick for you – as you yourself stated in response to Justin Harvey‘s answer – reassures me that the problem lies somewhere else.


    PS. From UX perspective, disabling the button is much better than just ignoring clicks, because it gives your user some visual feedback: the command is not available now. Displaying a message: “not now, I’m doing this stuff already” might be even better perhaps. But leaving a button clickable while not reacting to clicks is bad.


    Update: after OP’s clarified the issue (in a comment)

    Well, when the button is pressed, I immediately disable it, then the
    data processing sequence follows and when it finishes I re-enable the
    button. But I think that the issue has something to do with the fact
    that data processing it making the application unresponsive, yet the
    form still registers the clicks and the button gets pressed again
    after being re-enabled.

    You should run this operation asynchronously (on a background thread). Use a BackgroundWorker object and reenable the button in its RunWorkerCompleted event.

    It solved the problem.

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

Sidebar

Related Questions

I am trying to block a user's PC permanently from using my website. Until
I'm trying to block certain types of characters from being inserted into my Edit
I'm trying to display some checkbox in a form after getting the data from
I'm trying to block a script file from loading on user defined websites. To
I'm trying to block viewing a javascript page (.js) if user is not logged
I am trying to have a content block always be shown to the user,
I am trying to detect whether a block of text (from a textarea) contains
I'm trying to have the user input a block of text to the console
I have a date picker but i m trying the manual entry from user
I am trying to show the data coming from mysql database as a table

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.