tkinter问题
from tkinter import *root=Tk()
Label(root,text='请选择出生日期').pack(anchor=W)
s1=Scrollbar(root)
s1.pack(anchor=E,fill=Y)
l1=Listbox(root,yscrollcommand=s1.set)
for i in range(1900,2021):
l1.insert(END,i)
l1.pack(anchor=W,fill=BOTH)
s1.config(command=l1.yview)
root.mainloop()
怎么才能把这个滚动条放到列表框里,求解{:10_266:}
from tkinter import *
root=Tk()
Label(root,text='请选择出生日期').pack(anchor=W)
s1=Scrollbar(root)
s1.pack(side=RIGHT,fill=Y)
l1=Listbox(root,yscrollcommand=s1.set)
for i in range(1900,2021):
l1.insert(END,i)
l1.pack(side=LEFT,fill=BOTH)
s1.config(command=l1.yview)
root.mainloop() from tkinter import *
root=Tk()
Label(root,text='请选择出生日期').pack(anchor=W)
s1=Scrollbar(root)
s1.pack(side=RIGHT,fill=Y)
l1=Listbox(root,yscrollcommand=s1.set)
for i in range(1900,2021):
l1.insert(END,i)
l1.pack(side=RIGHT,fill=BOTH)
s1.config(command=l1.yview)
root.mainloop()
页:
[1]