MDI子表单不显示阴影效果 [英] Shadow effect is not showing for MDI Child Form

查看:60
本文介绍了MDI子表单不显示阴影效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



$
我将MDI子表格(表格2)放在MDI容器表格内( Form1),我试图使用下面的代码为父表单添加阴影效果.b


受保护的覆盖CreateParams CreateParams 
{
get
{
CreateParams cp = base.CreateParams;
cp.ClassStyle | = 0x00020000;
返回cp;
}
}



但它不适用于MDI儿童表格。


关心,



Aiswarya

解决方案

< blockquote>

请参阅https://docs.microsoft.com/en-us/windows/desktop/winmsg/window-class-styles



CS_DROPSHADOW
0x00020000

在窗口上启用阴影效果。通过
SPI_SETDROPSHADOW 打开和关闭效果。通常,这对于诸如菜单之类的小的短期窗口来说是启用的,以强调它们与其他窗口的Z顺序关系。从具有此样式的类创建的Windows必须是顶级窗口;他们
可能不是子窗口。



MDI子窗口不是顶级窗户。所以它不能有影子。



Hi Team,


I am having an MDI Child Form(Form2) placed inside a MDI container Form(Form1), I tried to added shadow effect to the child form using the below code which worked for parent form.

protected override CreateParams CreateParams
		{
			get
			{
				CreateParams cp = base.CreateParams;
				cp.ClassStyle |= 0x00020000;
				return cp;
			}
		}


But it didn't work for MDI Child Form.

Regards,

Aiswarya

解决方案

See https://docs.microsoft.com/en-us/windows/desktop/winmsg/window-class-styles

CS_DROPSHADOW
0x00020000
Enables the drop shadow effect on a window. The effect is turned on and off through SPI_SETDROPSHADOW. Typically, this is enabled for small, short-lived windows such as menus to emphasize their Z-order relationship to other windows. Windows created from a class with this style must be top-level windows; they may not be child windows.

A MDI child window is no a top-level windows. So it can't have a shadow.


这篇关于MDI子表单不显示阴影效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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