How to remove just the window border? How to remove just the window border? tkinter tkinter

How to remove just the window border?


I think this is what you were asking for. I don't know if you can do this without using Toplevel or not, but here's a small example of what you could do to remove the window border and keep the icon in the taskbar.

import tkinter as tkroot = tk.Tk()root.attributes('-alpha', 0.0) #For icon#root.lower()root.iconify()window = tk.Toplevel(root)window.geometry("100x100") #Whatever sizewindow.overrideredirect(1) #Remove border#window.attributes('-topmost', 1)#Whatever buttons, etc close = tk.Button(window, text = "Close Window", command = lambda: root.destroy())close.pack(fill = tk.BOTH, expand = 1)window.mainloop()

You could then add buttons, labels, whatever you want to window


In case you're using a Canvas (because this thread is the first result in Google) and you have those borders annoying you, when you want your canvas to BE the window, the Canvas' constructor has a parameter that should suit your needs : highlightthickness=0

import tkinter as tkroot = tk.Tk()root.overrideredirect(True)w, h = 800, 500canvas = tk.Canvas(root, width=w, height=h, highlightthickness=0)# ...# Do your things in your canvas# ...canvas.pack(fill='both')root.mainloop()