如何在vb.net中添加表单昏暗功能 [英] How to add form dim functionality in vb.net

查看:63
本文介绍了如何在vb.net中添加表单昏暗功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在VB.net中向表单添加暗淡功能,例如在Windows Vista或Windows 7中,当前台显示消息框时,背景暗淡?

How to add dim functionality to the form in VB.net, like when it happens in Windows vista or Windows 7 when a message box is displayed in foreground, the background form is dimmed?

推荐答案

xiroH4ck3r写道:
xiroH4ck3r wrote:

呵呵



看在天堂的份上,不要再这样做了.真烦人至少对我来说.

您可以在表单中添加透明面板,也可以更改表单的不透明度(如果这样对您有利).



For heaven''s sake do not do this again. It is annoying. At least for me.

You can add a transparent panel to your form or change the opacity of the form if that is good for you.


我使用类似的方法,仅使用表单,使用以下命令将其变为半透明不透明度,并使用ShowDialog()使其显示为应用程序模式.在表单构造函数中,我调整其大小并将其放置在原始表单上.

这与其他答案非常相似,但是通过这种方式,我不会用不必要的面板或其他控件来弄乱"我的原始表单,而使暗淡"消失的逻辑可以单独放置在另一种表单中.的代码...
I use a similar approach, only I use a form, make it semitransparent using the opacity, and show it using ShowDialog() to make it application modal. In the form constructor I resize it and position it over the original form.

It''s quite similar to the other answer, but this way I don''t "clutter" my original form with unnecessary panels or other controls, and logic to make the "dim" disappear can be placed separately in the other form''s code...


这篇关于如何在vb.net中添加表单昏暗功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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