首页 > 解决方案 > 滚动条颜色不改变颜色

问题描述

我正在尝试更改 tkinter 程序中滚动条的颜色,但它没有改变,请帮忙。

from tkinter import *
import tkinter as tk
root = tk.Tk()
root.geometry('1000x800')
root.configure(bg='blue')
TextArea = Text(root, width=20,bg='#373B3F')
TextArea.place(x=350, y=40, width=250, height=250)
sscrollbar = tk.Scrollbar(TextArea, orient='vertical')
sscrollbar.pack(side=RIGHT, fill=Y)
TextArea.configure(yscrollcommand=sscrollbar.set)
sscrollbar.configure(command=TextArea.yview)
sscrollbar.configure(activebackground='red',bg='red')

root.mainloop()

标签: pythontkinterscrollbar

解决方案


推荐阅读