【发布时间】:2020-02-06 13:00:34
【问题描述】:
我想知道如何更改 tkinter Label 或 Button 的边框颜色,我将 releif 放在 solid 中,边框颜色将为黑色。我试过highlightthickness,highlightcolor,highlightbackground 但它不起作用
这是我的代码示例:
import tkinter as tk
root = tk.Tk()
root.geometry("800x450")
root.title("How should i change border color")
tk.Label(root,text = "How should i change border color",width = 50 , height = 4 ,bg = "White",relief = "solid").place(x=10,y=10)
tk.Button(root,text = "Button",width = 5 , height = 1 ,bg = "White",relief = "solid").place(x=100,y=100)
root.mainloop()
这是我想要改变的(现在是黑色的边框颜色,我想把它改为红色):
我已经尝试过你所说的@moshe-perez,但它不起作用: image
【问题讨论】:
标签: python tkinter border tk border-color