1

I use scrollbar widget and I want to change the shape of it. Here's my questions below.

  1. Can I use the image on the scroll bar?
  2. How can I modify the color and shape with the options like relief, background, highlightbackground, highlightcolor or highlightthickness? I already tried but not a thing has changed.
from tkinter import *
root = Tk()
root.geometry("640x480")

frame = Frame(root)
frame.pack()

scrollbar = Scrollbar(frame, relief=RAISED, width=20, bd=5, activebackground="yellow", elementborderwidth=10, troughcolor="yellow", highlightbackground="red")
scrollbar.pack(side="right", fill="y")

listbox = Listbox(frame, selectmode="extended", height=10, bg="green", fg="white", yscrollcommand=scrollbar.set)
for i in range(1, 32):
    listbox.insert(END, str(i) + "day")
listbox.pack()

scrollbar.config(command = listbox.yview) # scrollbar와 listbox를 mapping 해줌

root.mainloop()
Art
  • 2,836
  • 4
  • 17
  • 34
  • 1
    Does this answer your question? [Changing the appearance of a Scrollbar in tkinter (using ttk styles)](https://stackoverflow.com/questions/28375591/changing-the-appearance-of-a-scrollbar-in-tkinter-using-ttk-styles) – Matiiss Oct 27 '21 at 16:43

0 Answers0