tkinter.Listbox(background)


Definition
The set the background color of the Listbox.

Syntax
Listbox(background=color)

Example
The Listbox is created through for loop.
from tkinter import*
 
master=Tk()
master.title("Listbox")

listbox=Listbox(master, background="Blue", fg="white",selectbackground="Red",highlightcolor="Red")
listbox.grid(row=1, column=1)

for x in range(1, 10):

    listbox.insert(END, x)

master.mainloop()




Comments