开发者

WinForms Dialogs in WPF Application: Controls look like .NET 2.0

I have an WinForms application and started to convert it into WPF. To have less work, my idea was to let the old dialog windows be WinForms. In the VS2010-designer the dialogs looks normal (with .NET 3.5/4.0 controls) but if I run my program all WinForms controls change into an old style and it looks like .NET 2.0 (I think you know what I mean, that grey bevel style for all controls...)

What happens 开发者_如何学运维there? Any ways to fix that?


You have to call System.Windows.Forms.Application.EnableVisualStyles() to enable the system style for Windows Forms. The WinForms project template contain that call by default; the WPF template is missing it as WPF controls do not need it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜