How to change the size of text on a label in Tkinter?

The label widget in Tkinter is used to display text and images in a Tkinter application. In order to change the properties of the label widget such as its font-property, color, background color, foreground color, etc., you can use the configure() method.

If you want to change the size of the text in a Label widget, then you can configure the font=('font-family font-size style') property in the widget constructor.


# Import the required libraries
from tkinter import *
import tkinter.font as tkFont

# Create an instance of tkinter frame or window

# Set the size of the tkinter window

def font_style():
   label.config(font=('Helvetica bold', 26))

# Create a Label
label = Label(win, text="Click the Button to Change the Font Style.", font=('Times', 24))

b1 = Button(win, text="Change the Label Size", command=font_style)



When you run the above code, it will display a window with a label widget and a button to change the font style of the label.

Now, click the "Change the Label Size" button and it will modify the font style of the label.

Updated on: 06-Aug-2021

21K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started