zoukankan      html  css  js  c++  java
  • Tkinter的Label组件

    Label 标签控件;可以显示文本和位图

    标签控件;可以显示文本和位图

    一、基本使用

    程序效果,显示标签内容

    效果如下:

    image

    代码如下:

    # coding:utf8
    from tkinter import *
    
    
    class App:
        def __init__(self, master):
            frame = Frame(master, width=100, height=70)
            frame.pack()
            Label(frame, text="标签1", width=20).grid(row=0, column=0)
            Label(frame, text="标签2", width=20).grid(row=0, column=1)
            Label(frame, text="标签3", width=20).grid(row=0, column=2)
            Label(frame, text="标签4", width=20).grid(row=0, column=3)
            # 第二行
            Label(frame, text="标签1", width=20).grid(row=1, column=0)
            Label(frame, text="标签2", width=20).grid(row=1, column=1)
            Label(frame, text="标签3", width=20).grid(row=1, column=2)
            Label(frame, text="标签4", width=20).grid(row=1, column=3)
    
    
    root = Tk()
    win = App(root)
    root.mainloop()


    读书和健身总有一个在路上

  • 相关阅读:
    eslint自动格式化
    焕肤功能
    Web Components
    Webpack 中的 sideEffects
    andriod 新建Activity_ Form
    那么唯美
    C# PDF添加水印
    停止触发器
    sp_sys_ERPTrigger_base
    sql语句返回主键SCOPE_IDENTITY()
  • 原文地址:https://www.cnblogs.com/Renqy/p/12836443.html
Copyright © 2011-2022 走看看