How to set border color of certain Tkinter widgets? How to set border color of certain Tkinter widgets? tkinter tkinter

How to set border color of certain Tkinter widgets?


Just use

widget.config(highlightbackground=COLOR)

Furthermore, if you don't want that border at all, set the highlightthickness attribute to 0 (zero).


You have to set the two highlights (with and without focus) to have a continuous color.

from tkinter import *root = Tk()e = Entry(highlightthickness=2)e.config(highlightbackground = "red", highlightcolor= "red")e.pack()root.mainloop()