tkinter中的LabelFrame控件在Python3的字体颜色以及如何指定摆放的位置

Rockismej 2019-12-20 06:10:30

感觉这个控件功能乱的很,网上资料很少且都是错误的
tkinter中的LabelFrame控件在Python3的字体颜色以及如何指定摆放的位置?
...全文
490 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Newnotes 2020-11-30
  • 打赏
  • 举报
回复
from tkinter import * # 导入窗口控件 root = Tk() # 创建窗口 root.title("label-test") root.geometry("1024x668+500+100") # 小写x代表乘号500x400为窗口大小,+0+0窗口显示位置 lb4 = LabelFrame(root, width=500, height=500, text='选择操作', padx=8) lb4.grid(row=5, column=1) button1 = Button(lb4, text="退出", command=root.quit) # 创建按钮控件 button1.grid(row=5, column=1, sticky=W) # 位置显示在2行,0列,对齐方式 W ,N,S,E lb3 = LabelFrame(root, width=500, height=500, text='选择操作', padx=80,pady=20,foreground='red') lb3.grid(row=5, column=0) button3 =Button(lb3, text="开始爬取(简化管理)") # 创建按钮控件 button3.grid(row=5, column=1, sticky=W) # 位置显示在2行,0列,对齐方式 W ,N,S,E button = Button(lb3, text="开始爬取(重点管理)") # 创建按钮控件 button.grid(row=5, column=0, sticky=W) # 位置显示在2行,0列,对齐方式 W ,N,S,E button2 = Button(lb3, text="保存列表信息数据") # 创建按钮控件 button2.grid(row=5, column=3, sticky=W) # 位置显示在6行,0列,对齐方式 W ,N,S,E root.mainloop() 更详细属性参考:https://blog.csdn.net/tianmuha/article/details/80958760
guaguaguaguagu 2020-08-10
  • 打赏
  • 举报
回复
指定位置我用place我感觉比较舒服

37,721

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧