2020
11-25
11-25
Winform ComboBox如何独立绘制下拉选项的字体颜色
众所周知,cbo1.ForeColor会同时改变cbo1.Text和下拉选项字体颜色。独立绘制下拉选项字体颜色,ForeColor只对cbo1.Text颜色有效的办法,示例:privatevoidcb7_DrawItem(objectsender,DrawItemEventArgse){DrawCboItems(sender,e);}privatevoidcb7_SelectedIndexChanged(objectsender,EventArgse){SetCboTextColor(sender);}privatevoidSetCboTextColor(objectsender){ComboBoxcbx=senderasComboBox;...
继续阅读 >