在Windows 7上运行的winform应用程序中,我希望更改组合框的背景颜色以突出显示它.comboxbox的DropDownStyle为DropDownList.
当我以编程方式将BackColor属性更改为红色时,只有实际下拉列表的背景更改为红色.当未打开下拉列表时,显示所选值的组合框背景保持灰色.我能做什么,它也变红了?
在Windows XP上运行应用程序时,设置BackColor属性可正常工作
我注意到在C#中XML注释和代码注释可以通过更改工具>选项>环境>字体和颜色>显示项目中的设置来使用不同的颜色: - 注释:控制代码注释 - XML注释:控制XML注释
这适用于C#
///<summary>This XML comment is green</summary>
//This code comment is red
Run Code Online (Sandbox Code Playgroud)
但不是在VB.NET中
'''<summary>This XML comment appears red too even though it's configured as green</summary>
'This code comment is red
Run Code Online (Sandbox Code Playgroud)
有没有办法来解决这个问题?
当我使用DateTime.ParseExact时,我得到意想不到的结果.这是我的测试代码:
Dim MinVal As DateTime = #12:00:01 AM#
Dim MaxVal As DateTime = #11:59:59 PM#
Dim TooBig1, Equal1 As Boolean
Dim TooBig2, Equal2 As Boolean
Dim dt1 As DateTime = #12:00:01 AM#
Dim dt2 As DateTime = DateTime.ParseExact("12:00:01 AM", "hh:mm:ss tt", Globalization.DateTimeFormatInfo.InvariantInfo)
TooBig1 = (dt1.CompareTo(MaxVal) > 0)
Equal1 = (dt1.CompareTo(MinVal) = 0)
TooBig2 = (dt2.CompareTo(MaxVal) > 0)
Equal2 = (dt2.CompareTo(MinVal) = 0)
Run Code Online (Sandbox Code Playgroud)
对于dt1,结果很好:
但结果是(错误?)dt2出乎意料:
它看起来像是因为ParseExact系统地添加了这一天,即使我只在格式中指定时间.
我的问题是:我怎样才能用DateTime.ParseExact读取时间?