什么是&QUOT的最佳途径;暗淡" WinForm的背景,同时显示一个对话框? [英] What's the best way to "dim" background of winform while displaying a dialog?

查看:271
本文介绍了什么是&QUOT的最佳途径;暗淡" WinForm的背景,同时显示一个对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现我的应用程序中的功能,在展现给用户一个对话框,并在主窗体(类似的jQuery看起来如何)。我唯一​​的想法就是要把形式的截图,把它作为一个面板(不透明度合我意)的背景,然后按下面板上的一切形式。我不得不相信有这样做的更好的办法,有什么建​​议?

I'd like to implement a feature in my application where show a dialog to the user, and the main form (similar to how jQuery looks). My only idea is to take a screenshot of the form, place it as the background of a panel (with opacity to my liking) then pushing the panel over everything on the form. I have to believe there is a better way of doing this, any suggestions?

推荐答案

Opacity属性是你所需要的黯淡的一种形式。您需要在创建覆盖,我的code <一个href="http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/f95407be-3d2a-4286-8e04-912a3706a486">this螺纹展示了如何做到这一点。

The Opacity property is what you need to "dim" a form. You'll need to create an overlay, my code in this thread shows how to do this.

注意不要使它看起来像你的程序显示UAC提示。虽然可能在适当的浏览器,用户将不会有任何问题认识到通过一个对话框覆盖的窗口被禁​​止。控制涂料本身不同要想清楚。

Be careful to not make it look like your program is displaying a UAC prompt. While perhaps appropriate in browsers, the user will never have any trouble recognizing that a window overlaid by a dialog is disabled. Controls paint themselves differently to make it clear.

这篇关于什么是&QUOT的最佳途径;暗淡&QUOT; WinForm的背景,同时显示一个对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆