- 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 to fully change the color of a Tkinter Listbox?
Tkinter Listbox widgets are very useful in the case of representing a large set of data items in form of list items. To configure the properties such as change the background color of the entire Listbox, we can use configure(**options) method to change the properties of the Listbox widget.
Example
# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Add a Listbox widget with number as the list items listbox =Listbox(win) listbox.insert(END,"C++", "Java", "Python", "Rust", "GoLang", "Ruby", "JavScript", "C# ", "SQL", "Dart") listbox.pack(side=LEFT, fill=BOTH) listbox.configure(background="skyblue4", foreground="white", font=('Aerial 13')) win.mainloop()
Output
Running the above code will display a customized Listbox with some list items in it.
- Related Articles
- How can I change the text of the Tkinter Listbox item?
- How to change the color of a Tkinter label programmatically?
- How to clear a Tkinter ListBox?
- How to change the color of a Tkinter rectangle on clicking?
- How to change the background color of a Treeview in Tkinter?
- How to change the background color of a tkinter Canvas dynamically?
- Is it possible to color a specific item in a Tkinter Listbox widget?
- How to change the color of ttk button in Tkinter?
- How to change the mouse pointer color in Tkinter?
- How to edit a Listbox item in Tkinter?
- How to change text cursor color in Tkinter?
- How to change the color of certain words in a Tkinter text widget?
- How to fit Tkinter listbox to contents?
- How to display a Listbox with columns using Tkinter?
- How to keep selections highlighted in a Tkinter Listbox?

Advertisements