tkinter ttk.Combobox Combobox 下拉框设置背景颜色
ttk.Combobox,下拉框设置背景颜色
代码如下:
combostyle = tkinter.ttk.Style()
combostyle.theme_create('combostyle', parent='alt',
settings={'TCombobox':
{'configure':
{
# 'foreground': 'white',
'selectbackground': 'black', # 选择后的背景颜色
'fieldbackground': '#eeffcc', # 下拉框颜色
'background': '#2d78f4', # 背景颜色
"font":10, # 字体大小
"font-weight": "bold"
}}}
)
combostyle.theme_use('combostyle')
效果: