赞
踩
1.以下代码为配置进度条的参数,需要from tkinter import ttk
style = ttk.Style(win)
style.layout('elem1.Horizontal.TProgressbar',
[('Horizontal.Progressbar.trough',
{'children': [('Horizontal.Progressbar.pbar',
{'side': 'left', 'sticky': 'ns'})],
'sticky': 'nswe'}),
('Horizontal.Progressbar.label', {'sticky': ''})])
2.假如控件名称为elem1,elem1.cofig()就显示以上配置的进度条了,以上进度条已配置百分比进度条内显示
elem1 = ttk.Progressbar(win, orient=HORIZONTAL, length=200, mode="determinate", maximum=100, value=0)
elem1.place(relx=0.3, rely=0.04, relwidth=0.16, relheight=0.03)
elem1.config(style='elem1.Horizontal.TProgressbar')
style.configure('elem1.Horizontal.TProgressbar', font=('Microsoft YaHei', 11))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。