In my user control I perform a lengthy operation. In order to prevent users from clicking the UI, I show a progress bar and I disable the whole UI, like this:
this.Enabled = false;
ShowProgressBar();
DoLengthyOperation();
RemoveProgressBar();
this.Enabled = true;
This works OK. However, my user control has many other controls on it, which also have controls inside them, which also have controls inside them,... etc. The
this.Enabled = false
call thus disables many many controls. This is intentional. But the problem I have is that you can actually see the UI disabling every control one by one. It goes pretty fast but since there are so many controls, you can actually see it running through all the controls. This does not look professional, it makes the screen flicker and my eyes hurt.
Is there a way so that I can prevent the UI from redrawing until all controls are disabled and then perform a single redrawing?
I hope this is not a stupid question ;)
Don't know if this is relevant: my controls are derived from DevExpress.XtraEditors.XtraUserControl.