在 UltraCalendarCombo 的编辑器部分设置颜色

发布于 2024-08-07 09:32:42 字数 143 浏览 5 评论 0原文

有谁知道如何以编程方式(即不使用样式库文件)为 UltraCalendarCombo(winforms 之一)的编辑器部分(您可以在其中输入日期)着色?

我想在控件获得焦点时将背景设置为不同的颜色,但找不到任何属性或方法来执行此操作。

谢谢

Does anyone know how to colour the editor part (where you can type in the date) for the UltraCalendarCombo (winforms one) programmatically (i.e. without using the Style Library files)?

I want to set the background to a different colour whenever the control has focus but can't find any properties or methods to do this.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小帐篷 2024-08-14 09:32:42

如果我理解正确的话,我相信你可以通过以下两种方式之一来做到这一点......

// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance = new Infragistics.Win.Appearance { BackColor = Color.Blue };

If I understand you correctly, I believe you can do it one of 2 ways...

// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance = new Infragistics.Win.Appearance { BackColor = Color.Blue };
软糖 2024-08-14 09:32:42

我实际上已经弄清楚了这一点。

Steve 的回答为编辑器部分着色,< strong>下拉部分也是如此。
您还需要应用其他外观属性。

// This is a copy from Steve's answer
// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance
    = new Infragistics.Win.Appearance { BackColor = Color.Blue };

// Now we set the drop down part to a different colour (Let's say white)
ultraCalendarCombo1.DropDownApperance
    = new Infragistics.Win.Appearance { BackColor = Color.White };

我相信您可以通过创建 .isl(Infragistics Style Library)文件来做到这一点,但我不太确定如何以编程方式交换这些文件。

I've actually figure this one out.

Steve's answer colours the editor part and the drop down part as well.
You need to apply other Appearance properties as well.

// This is a copy from Steve's answer
// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance
    = new Infragistics.Win.Appearance { BackColor = Color.Blue };

// Now we set the drop down part to a different colour (Let's say white)
ultraCalendarCombo1.DropDownApperance
    = new Infragistics.Win.Appearance { BackColor = Color.White };

I believe you can do it by creating .isl (Infragistics Style Library) files but I wasn't quite sure how to swap these in and out programmatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文