简体   繁体   English

如何在WinForms ComboBox AutoComplete下拉菜单中设置格式

[英]How to set the format on a WinForms ComboBox AutoComplete drop down

I'm using a Winforms ComboBox, specifying the background color and font programatically. 我正在使用Winforms ComboBox,以编程方式指定背景颜色和字体。 I've also set AutoCompleteMode to "Suggest" and AutoCompleSource to "ListItems", via the designer properties. 我还通过设计器属性将AutoCompleteMode设置为“ Suggest”,将AutoCompleSource设置为“ ListItems”。

Autocomplete seems to work great, but the drop down it displays for auto complete uses the Winforms default background color and font. 自动完成功能看起来很棒,但是显示为自动完成的下拉菜单使用Winforms默认的背景颜色和字体。 I'd like it to match the background color and font of the rest of the control. 我希望它与其余控件的背景色和字体匹配。 Does anyone know how to accomplish this in .Net 4.0? 有谁知道如何在.Net 4.0中做到这一点?

Thanks for your help. 谢谢你的帮助。

AFAIK you cannot do this. 抱歉,您无法执行此操作。 Setting the background colour only affects the "TextBox" part of a ComboBox, ie when you are using a ComboBox in DropDown style (default) allowing the user to enter free text as well as selecting from the list. 设置背景颜色仅会影响ComboBox的“ TextBox”部分,即,当您使用DropDown样式的ComboBox(默认)时,允许用户输入自由文本以及从列表中进行选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM