开发者

Why does MonthCalendar look different in 3rd party app?

开发者 https://www.devze.com 2023-02-05 07:27 出处:网络
I\'m currently working on a plug-in dll for a 3rd party application.Part of my dll includes a pop-up window with a System.Windows.Forms.MonthCalendar in it.Now when I work on it in Visual Studio and w

I'm currently working on a plug-in dll for a 3rd party application. Part of my dll includes a pop-up window with a System.Windows.Forms.MonthCalendar in it. Now when I work on it in Visual Studio and when I open the pop-up with a test application I wrote it looks one way, but when the 3rd party app opens it, it looks different. On top of looking different they also have different behaviors. Does anyone have any idea why? One thing that I thought might be an issue is that my dll is built with .Net 3.5 and the 3rd party app is .Net 2.0 (I think). But when I built my test application 开发者_开发百科as .Net 2.0 it still worked the same way.

Here's what I'm expecting:

Why does MonthCalendar look different in 3rd party app?

And here's what I'm getting:

Why does MonthCalendar look different in 3rd party app?


The 3rd-party application is not enabling visual styles, and is therefore falling back on the classic Windows UI theme. Note that the button and combo boxes don't look the same either. You would have to enable visual styles in the 3rd-party application to apply the current Windows theme to it.

(As an exercise, try switching your Windows preferences to use the classic theme and then look at the working test application -- it should look identical to the 3rd-party one.)

0

精彩评论

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