我希望将tkinter组合框的默认白色更改为橙色,并在选择时将其更改为绿色。我找不到如何瞄准全场,我只能改变字体颜色。你知道吗
我搜索了论坛和网络,但在任何地方都找不到解决方案。 我设法将Listbox的颜色设置为橙色,但没有设置默认值。你知道吗
列表框背景
window.option_add("*TCombobox*Listbox*Background", 'orange')
我的组合框样式
ttk.Style().layout('combostyleO.TCombobox')
ttk.Style().configure('combostyleO.TCombobox', selectforeground='black', selectbackground='orange', background='green', foreground='orange', padding=4)
组合框创建
lendersR = StringVar(window)
lendersR.set('Select lender') # set the default option
choicesR = excel.Excel().get_resi_lenders_from_csv()
choicesR = sorted(choicesR)
lenderMenuR = ttk.Combobox(window, width=55, height=30, font="Courier 10", textvariable=lendersR, values=choicesR, style="combostyleO.TCombobox")
目前没有回答
相关问题 更多 >
编程相关推荐