【发布时间】:2018-11-01 12:29:38
【问题描述】:
如何在 tkinter 中更改边框的颜色
我查看了推荐使用highlightcolor 和highlightbackground 的其他解决方案,但是这些都不起作用。
excercises_button = Button(canvas, width=327, height=150, image=dumbell_img,borderwidth=4, relief="ridge", bg = "gray55", command = Excercises)
canvas_excercises_button = canvas.create_window(168, 724, window=excercises_button)
我希望这个按钮的边框是橙色的。
这是它目前的样子: https://i.stack.imgur.com/3QX8X.png
【问题讨论】:
-
为了创建边框,您需要将按钮添加到其自己的框架中,并使用该框架的背景颜色来制作与按钮不同的颜色边框。