Tkinter的按钮无法更改边框颜色 [英] Tkinter's button can't change border color
本文介绍了Tkinter的按钮无法更改边框颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的Tkinter代码:
Here's my Tkinter code:
Photoshop = Tkinter.Button(root,
text = 'Photoshop',
fg = '#37d3ff',
bg = '#001d26',
bd = 10,
highlightthickness=4,
highlightcolor="#37d3ff",
highlightbackground="#37d3ff",
borderwidth=4)
但是,之后我将我的按钮网格化,边框的颜色没有显示。而是使用默认的灰色。
However, after I grid my Button, the color of border doesn't shows up. Instead, it used default grey.
推荐答案
您可以将按钮放置在其自己的框架中,如下所示:
You may place the button inside its own frame like this:
buttonborder = Tkinter.Frame(root,
highlightbackground="#37d3ff",
highlightcolor="#37d3ff",
highlightthickness=4,
bd=0)
photoshop = Tkinter.Button(buttonborder,
text='Photoshop',
fg='#37d3ff',
bg='#001d26')
这篇关于Tkinter的按钮无法更改边框颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文