知识点目录:
1、 文本框 Label
var = tk.StringVar()
# 文本框   bg 背景颜色   fonnt 字体设置    width 长   height 高
l = tk.Label(root, textvariable=var, bg='green', font=('Arial',12), width=15)
l.pack()
tkinter学习笔记_01
2、按钮 Button
 
on_hit = False
# 按钮
def hit_me():
    global on_hit
    if on_hit == False:
        on_hit = True
        var.set("sasdad")
    else:
        on_hit = False
        var.set("")

# command 执行动作
b = tk.Button(root, text='按钮', width=15, height=2, command=hit_me)
b.pack()

tkinter学习笔记_01

3、单行输入框     entry

# entry 单行输入框, show显示,掩码的话就show='*',
e = tk.Entry(root, show=None)
e.pack()

tkinter学习笔记_01

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-06-11
  • 2021-08-22
猜你喜欢
  • 2021-08-14
  • 2021-12-26
  • 2021-07-27
  • 2021-06-23
  • 2021-08-13
  • 2022-12-23
  • 2021-07-28
相关资源
相似解决方案