[英]Python, Tkinter, Change of label color
Is there a simple way to change the color of a text in a button? 有没有简单的方法可以更改按钮中文本的颜色?
I use button['text'] = 'input text here'
to change what the button text will be after the push. 我使用button['text'] = 'input text here'
来更改按钮文本在按下后的显示效果。 Does something similar exist for the change of color, button['color'] = 'red'
? 是否存在类似的颜色更改, button['color'] = 'red'
?
Use the foreground
option to set a color of the text in a button. 使用foreground
选项可以设置按钮中文本的颜色。
Example: 例:
button.configure(foreground="red")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.