There are a lot of border types that you can choose from while using Python Tkinter Label.
- flat
- raised
- sunken
- ridge
- solid
- groove
1. Flat
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with flat border', borderwidth=2, relief='flat')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
2. Raised
tkinter - raised label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with raised border', borderwidth=2, relief='raised')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
3. Sunken
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with sunken border', borderwidth=2, relief='sunken')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
4. Ridge
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with ridge border', borderwidth=2, relief='ridge')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
5. Solid
tkinter - solid label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with solid border', borderwidth=2, relief='solid')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
6. Groove
tkinter - groove label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with groove border', borderwidth=2, relief='groove')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
More Posts related to Python,
- How to Install Python Modules in VS Code
- 3 Python program to add two numbers
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- Python: How to get Current Directory
- Python - Convert float to String
- Tkinter - add x and y padding to label text
- Check if String Contains a Substring - Python
- Read JSON File in Python Program
- How to Convert String to DateTime in Python
- Sorting an array using Bubble Sort in Python Programming
- Python Hello World! Program with code example (snippet)
- How to delete a dir or folder using Python code
- Change label (text) color in tkinter
- Set width and height for the label in tkinter
- Check version of pip package installer for Python
- Reading JSON file in Python with Examples
- Indent Python code in Notepad++
- tkinter - Hello World! Program
- How to resolve Failed to create interpreter PyCharm Error
- Base64 Encoding Decoding in Python Programming
- How to pip install Python Modules in VSCode
- How to take user input from the console in a Python program
- Take input argument from command line in Python Programming
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- Calculate discount amount python code
More Posts:
- How to initiate a photo request on iPhone from Mac Monterey - iOS
- Calculate discount amount python code - Python
- Failed to find provider info for com.facebook.katana.provider.PlatformProvider - Android
- Remove Trailing zeros BigDecimal Java - Java
- How to change directory in Git bash - Git
- [Solved] SharePoint Access Denied error editing Document Name - SharePoint
- Share Multiple Images in WhatsApp using Android Intent - WhatsApp
- Permanently Set or Change $JAVA_HOME on Mac (macOS) - MacOS