0

I would like to know how to add a scrollbar with two LabelFrame in Python (Tkinter)?

Example is as follow: enter image description here

My code:

from tkinter import *

root = Tk()
root.geometry('200x500')

labelframe1 = LabelFrame(root, text="Label Frame 1")
labelframe1.place(x=10, y=0, width=100, height=600)

labelframe2 = LabelFrame(root, text="Label Frame 2")
labelframe2.place(x=130, y=0, width=100, height=600)

for i in range(200):
    Label(labelframe1, text=i).grid(row=i, column=0)
    Label(labelframe2, text=i).grid(row=i, column=1)

root.mainloop()

Thank you.

I would like ti konw how to add a scrollbar with two LabelFrame in Python (Tkinter)?

Bas H
  • 2,114
  • 10
  • 14
  • 23
  • please write your code in code snippet – Coder Feb 07 '23 at 15:36
  • 2
    You *can't* add a scrollbar to a LabelFrame - only a few specific Tkinter widgets support scrolling, and this isn't one of them. If you look at any Tkinter scrollbar example, you will see that the general approach is to use a Canvas (which *is* scrollable), and add your widget(s) to that Canvas via `.create_window()`. – jasonharper Feb 07 '23 at 15:52
  • Does this answer your question? [Tkinter - Add scrollbar for each LabelFrame](https://stackoverflow.com/questions/21429014/tkinter-add-scrollbar-for-each-labelframe) – toyota Supra Jul 19 '23 at 13:48

0 Answers0