Vii*_*iin 2 python tkinter widget
有没有办法可以改变 python 中禁用条目小部件的颜色?
x = tk.Entry(parent)
x.configure({"background": "gray24"})
x.configure({"fg": "white"})
x.configure({"state": "disable"})
Run Code Online (Sandbox Code Playgroud)
上面的代码仅在小部件的“状态”为“正常”时才有效。
小智 5
设置条目小部件的disabledbackground
属性。
x.configure({"disabledbackground": "newcolour"})
Run Code Online (Sandbox Code Playgroud)
"newcolour"
禁用条目小部件时您希望看到的颜色在哪里。您还可以使用disabledforeground
前景色,而不是背景色。
归档时间: |
|
查看次数: |
2226 次 |
最近记录: |