Tkinter

How to Stop a Tkinter Window From Resizing

In this tutorial, we are going to see how to Stop a Tkinter window from resizing in Python.

The resizable() method is used to allow the Tkinter root window to change its size according to the users’ needs. We can also prevent resizing the Tkinter window.

So if the user wants to create a fixed size window, this method can be used.

root.resizable(height = None, width = None)

To make the window non-resizable, the user can pass the value 0 or False.

The user can pass a positive integer or True to make the window resizable.
 

 

How to Stop a Tkinter Window From Resizing
from tkinter import *   

root = Tk()
root.geometry('200x200')  

root.resizable(width=False, height=False)

root.mainloop()

Output:


 
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *