I am working on an Youtube Mp3 converter. Mp3 converting takes a few seconds and I want the user not able to click any control on the form. I have done it using Control.Enabled = false
for all control but I think this way is not professional and doesn't seems good for visuality. Is there any good method to do this?
Asked
Active
Viewed 4,394 times
2

Ali Tor
- 2,772
- 2
- 27
- 58
-
Please explain this: "and doesn't seems good for visuality". Control.Enabled = false does exactly what you want, i.e., disables the user interaction. – lenkan Mar 24 '16 at 22:43
-
disable the entire form, show a progressbar in marquee mode, change cursor to Busy. take your pick, its your app – Ňɏssa Pøngjǣrdenlarp Mar 24 '16 at 22:43
-
... or show a modal dialog form. – LarsTech Mar 24 '16 at 22:48
-
The modal dialog would inform the user that you are working and disable the ability to interact with the form, or you can disable the form and post a message on the form. – Mar 25 '16 at 01:03
1 Answers
8
As comments says you can have a modal form:
yourModalForm.ShowDialog();
Which have no title bar buttons or no title bar at all and will close itself after conversion is done.
Or you can use Enabled
property as yourself suggested but not for every control, you can do it for your whole form at once:
this.Enabled = false;
Remember that this
is your form if you are in the right context.
I also suggest you to change your form cursor, like that:
this.Cursor = Cursors.WaitCursor;
And when your work is finished all you have to do is:
this.Enabled = true;
this.Cursor = Cursors.Default;

Logerfo
- 469
- 5
- 17