Full Screen Window in Tkinter 

If You Want to Create Full Screen Window in Python tkinter Just Follow this ..........

Method 01: You Can Use state Function.

Syntax:  root.state("zoomed")

from tkinter import *
root= Tk()
root.title("Automatically Maximize Window")
root.geometry("800x350+450+86")
root.config(bg="#CAFF70")
root.state("zoomed") #It Maximize Automatically
lbl= Label(win, text= "Maximize Window", font=("Time New Roman", 35,"bold"), bg="#CAFF70",
fg="red")
lbl.pack(pady=60)
root.mainloop()

Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.



Method 02: You Can Use attributes() Function

Syntax:  win.attributes("-fullscreen", "true")
Here win is use, instead of root

from tkinter import *
win= Tk()
win.title("Automatically Maximize Window")
win.geometry("800x350+450+86")
win.config(bg="#CAFF70")
win.attributes("-fullscreen", "true")

lbl= Label(win, text= "Automatically Maximize Window", font=("Time New Roman"
                  35,"bold"), bg="#CAFF70",fg="red")

lbl.pack(pady=60)
win.mainloop()

Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.

The output has no Minimize, Maximize and Close Window.

Lets Enjoy..................................


Post a Comment

Previous Post Next Post