Windos Form不透明度控件,无需更改其内容的不透明度 [英] Windos Form Opacity control without change the opacity of his content

查看:144
本文介绍了Windos Form不透明度控件,无需更改其内容的不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Friends
我想控制表格的不透明度.我能做到.但是我的问题是当我减少表单的不透明度时,按钮,图片框等表单的内容的不透明度也会降低.我只想减少表格的不透明度,而不要减少其内容的不透明度.请帮助我.

Hi Friends
I want to control opacity of form. i can do it. but my problem is when i decrease opacity of form then opacity of content of form like button, picture box etc. are also decrease. and i want to decrease opacity of form only not his content''s opacity. please help me.

推荐答案

不幸的是,据我所知,在纯.NET中是不可能的.
在本机Windows中,有一种分层窗口"技术.

请参见:具有 [[
Unfortunately, it is not possible in pure .NET, to best of my knowledge.

In native Windows, there is a technique of "Layered windows".

See this: A non-rectangular top window with click-through shadow along the edge?[^], check out the Answer by mbue. I did not test this technique. I asked mbue about this possibility and see that there is no easy way to make it with available controls: you would need to re-create all using bitmaps, which does not sound realistic at all. Please see the reference about for explanation of technique and the summary of our discussion.

—SA


您可以创建具有不透明度的标准表单,然后将其与另一种(无模,无边界和透明背景)表单重叠所需的控件.当然,您必须自己管理两者之间的所有表单交互.这很麻烦-如果我是您,并且如果您绝对需要这种功能,我会考虑使用WPF而不是WinForms.
You could create a standard form with the opacity, and then overlay it with another (modeless, borderless, and transparent background) form which has all of the desired controls on it. Of course, you''d have to manage all of the form interaction between the two yourself. It''s a hassle - if I were you, and if you absolutely need that kind of functionality, I''d consider using WPF instead of WinForms.


这篇关于Windos Form不透明度控件,无需更改其内容的不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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