C#表单(或任何现有控件)向用户显示消息(无按钮等) [英] C# Form (or any existing control) to SHOW a MESSAGE to USER (without buton, etc.)
问题描述
嗨!
我尝试在执行操作时向用户显示MESSAGE. MESSAGE不会显示任何按钮,而只会显示MESSAGE(文本)和背景图片.
问题如下:MessageBox似乎不是一个很好的控件(由于按钮,它阻止了正在运行的进程),Form.ShowDialog()也阻止了正在运行的进程....我不知道该怎么办.
我想显示该消息,运行我的过程,并在过程完成后处置该消息.
如何在C#中实现此目标?
Hi !
I try to show a MESSAGE to the user while an operation is executed. The MESSAGE won''t show any button ... just a MESSAGE (text) and maybe a background image.
The problem is the following: MessageBox does not seem to be the good control (because of button and it blocks the running process), Form.ShowDialog() also blocks the running process .... I don''t know what to do.
I want to show the message, run my process, and dispose the message when the process is done.
How to achieve this in C# ?
推荐答案
您需要创建自己的消息框表单,并调用Show()
而不是ShowDialog();
来显示它.我建议您在研究无模式"表单之前先进行研究,以使您充分理解使用无模式表单的后果.
You need to create your own message box form, and callShow()
instead ofShowDialog();
to display it. I recommend that you research "modeless" forms before doing it so that you fully understand ther ramifications of using modeless forms.
使用Form.Show而不是Form.ShowDialog-它使它成为独立存在,控制权立即返回到您的原始形式.请记住要保留对新表单的引用,否则完成后将很难找到并摆脱它(使用form.Close).
Use Form.Show instead of Form.ShowDialog - it causes it to be stand alone and control returns to your original form immediately. Remember to keep a reference to the new form, or it will be hard to find and get rid of (with form.Close) when you are finished.
这篇关于C#表单(或任何现有控件)向用户显示消息(无按钮等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!