How to change background color in ttk.Combobox list?

How to change combobox list list style?

Here is the piece of code:

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)

How do I access the style of a list with a list?

Image example:

enter image description here

+4
source share
1 answer

Found! way to change the BG list of a list with a list:

import ttk
import Tkinter
root = Tkinter.Tk()

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

combo = ttk.Combobox().pack()
root.mainloop()
+3
source

Source: https://habr.com/ru/post/1598931/


All Articles