改变形式opactity不改变包含的控件的不透明度 [英] Changing form opactity without changing opacity of contained controls
问题描述
时,可以与 Windows窗体的.NET中,改变的不透明度形成没有它会自动改变窗体中的控件的透明度?
Is it is possible, with Windows Forms in .NET, to change the opacity of a form without it automatically changing the opacity of the controls within the form?
我有一台运行最大化的一种形式,它包含的形式与里面的控制中心的FlowLayoutPanel的。我想降低形式的透明度,使周围的FlowLayoutPanel中的多余的部分是部分透明的,但FlowLayoutPanel的本身仍然坚实(我瞄准了的收藏夹风格的影响)。
I have a form that is running maximized, that contains a flowlayoutpanel in the centre of the form with controls inside it. I would like to lower the opacity of the form so that the "spare" part around the flowlayoutpanel is partly transparent, but the flowlayoutpanel itself remains solid (im aiming for a lightbox style effect).
推荐答案
当然,这是有可能在WPF的窗体的背景设置为透明(而不是设置不透明度为0,基本上设置在两个前景透明度和背景)。
Of course, this is possible in WPF by setting the background of the form to transparent (as opposed to setting opacity to 0, which basically sets transparency on both foreground and background).
如果你真的想要,我不明白为什么你不能嵌入一个WinForms组件放入一个透明的WPF的形式,使用的WindowsFormsHost。
If you really wanted to, I don't see why you couldn't embed a winforms component into a transparent wpf form, using WindowsFormsHost.
这篇关于改变形式opactity不改变包含的控件的不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!