I want to prevent the user clicking two times on a button when it has been already executing and the process is not finished.
I am using compact framework 3.5 and I have problems when the user clicks two times on a button that is already executing or some other button. I want to disable all buttons when the program is executing and enable them again when the process is done.
OS: Windows mobile 6.1
Framework: .NET 3.5 CF
I found that I needed to do this quite often when building a windows mobile application so made a simple utility class.
All I need to do was then call one line to lock the form down.
FormUtility.FormState(this.Controls, false);You should end up with something like
EDIT : I think what @tcarvin is suggesting is that you do not need to call refresh on every control but simply invalidate the controls and then refresh the container which will cause all the invalidated controls to redraw at once. I haven’t tested this but a small change to something like…
Then use