- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I prevent a window from being resized with Tkinter?
Tkinter windows can be resized automatically by hovering and pulling over the window. We can disable the resizable property using the resizable(boolean value) method. We will pass false value to this method which will disable the window to be resized.
Example
#Import the tkinter library from tkinter import * #Create an instance of tkinter frame win = Tk() #Set the geometry win.geometry("650x250") Label(win, text= "Hello World", font=('Times New Roman bold', 20)).pack(pady=20) #Make the window resizable false win.resizable(False,False) win.mainloop()
Output
Running the above code will display the following the tkinter window, but you won't be able to resize it.
- Related Articles
- Execute a script when the browser window is being resized in HTML?
- How can I resize the root window in Tkinter?
- How do I close a tkinter window?
- How to prevent form from being submitted?
- How to Prevent Twitter Accounts from being Hacked
- How do I create a popup window using Tkinter?
- How do I create a popup window in Tkinter?
- How to delete Tkinter widgets from a window?
- How do I open a website in a Tkinter window?
- How do I create a popup window using Tkinter Program?
- How do I set a minimum window size in Tkinter?
- How do I position the buttons on a Tkinter window?
- How to prevent raw rice from being destroyed by termites?
- How to Set a Tkinter Window with a Constant Size?
- How do I insert a JPEG image into a Python Tkinter window?

Advertisements