【问题标题】:C# - 如何让我的月历在设计中看起来像
【发布时间】:2022-01-23 15:55:18
【问题描述】:

我制作了一个类似于 Microsoft ToDo 的应用程序。

我在日历所在的地方做了一个用户控件。

当我在设计中使用它时,它看起来像这样: https://ibb.co/XD0Wyj5

但是当我启动程序时,它看起来像这样:https://ibb.co/vv30xrw

我试过了

Application.EnableVisualStyles();

但它仍然看起来像这样。

我可以做些什么来让设计在启动的程序中?

【问题讨论】:

  • 尝试关闭视觉样式:Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;
  • 您不需要禁用整个应用程序的视觉样式,相反,您可能需要disable visual styles for the MonthCalendar control

标签: c# winforms monthcalendar


【解决方案1】:

查看VisualStyleState 参考 - https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/VisualStyles/VisualStyleState.cs,01ad4fcb5f9ea430,references

VisualStyleState.NoneEnabled 分配给 Application.VisualStyleState

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-23
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    相关资源
    最近更新 更多