Windows窗体的C#阴影 [英] C# shadow with Windows Form

查看:52
本文介绍了Windows窗体的C#阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< img src ="http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png"/>

http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png [

<img src="http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png"/>

http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png[^]
c# windows form, the form side of the shade, what can I do to.

I found this code but it does not implement the same as the shadow effect.
Equal to the amount of code required to do the shading.

private const int CS_DROPSHADOW = 0x20000;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ClassStyle |= CS_DROPSHADOW;
return cp;
}
}

推荐答案

Windows窗体不是WPF,所以为什么对它不起作用感到惊讶?
如果您确实希望Windows窗体上有阴影,则本文可能会有所帮助:
Windows Forms is not WPF, so why are you surprised that it doesn''t work?
If you really want a shadow on your Windows Forms, perhaps this article may help: Transparent drop shadow in C# (GDI+ and Windows Forms)[^]


private const int CS_DROPSHADOW = 0x20000;
   protected override CreateParams CreateParams
   {
   get
   {
   CreateParams cp = base.CreateParams;
   cp.ClassStyle |= CS_DROPSHADOW;
   return cp;
   }
   }



代码已经在您的过程中了,我

http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png [



code is already in the process that you, and I

http://marcin.floryan.pl/wp-content/uploads/2010/08/WPF-Window-native-shadow.png[^]

I want the shading as shown in the picture, ie in the form of subway style.


这篇关于Windows窗体的C#阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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