如何在ttk.Combobox的listview中更改背景颜色?

如何更改组合框列表视图的样式?

以下是目前代码的一部分:

style = ttk.Style()
style.configure("BW.TLabel", foreground="black", background="#20252b",
                insertbackground="white", fieldbackground= 'blue')
optmn = ttk.Combobox(self, style="BW.TLabel")
optmn.place(x=140, y=200, width=150, height=25)

如何访问组合框列表视图的样式?

示例图片:

解决方法:

找到了!更改组合框列表视图的BG的方法是:

import ttk
import Tkinter
root = Tkinter.Tk()

root.option_add("*TCombobox*Listbox*Background", 'green')

combo = ttk.Combobox().pack()
root.mainloop()
上一篇:c# – Combobox.Visible属性不起作用


下一篇:javascript – 在可编辑的网格中,如何在选择项目时使Ext组合框立即完成编辑模式?