开发者

"Pop up" form that disables access to form behind it

开发者 https://www.devze.com 2023-02-23 03:21 出处:网络
There is a term for this that I just cannot think of, and I\'m sure if I knew that word I wouldn\'t be asking this question as I\'d have found the answer on Google ... but I just cannot find the right

There is a term for this that I just cannot think of, and I'm sure if I knew that word I wouldn't be asking this question as I'd have found the answer on Google ... but I just cannot find the right terms for this.

I have a standard WinForms application (.NET 4.0) that I'm working with. I have a main form with three buttons, and each button performs an action silently in the background. Two of the buttons take quite some time to process. During the time it's processing, I'd like a small window to pop up that I can give little text updates to ("Doing Action A...", "Doing Action B...").

I do not want to give the user the ability to touch the main form while this window is open and running -- no closing it without using Task Manage开发者_Python百科r, no clicking other buttons, nothin'.

How do I spawn a small "child" form of the main form that will do just this?

PS: In addition to the text updates, I want to throw a small animated graphic on it too, like from ajaxload.info. Not sure if that affects the form/window type.


That would be called a modal dialog.


In WinForm, call ShowDialog to display the modal window.


And you can use ProgressBar to inform the user how long it left (or use Continuous style) if you dont know how long it will take

0

精彩评论

暂无评论...
验证码 换一张
取 消