用Tkinter 实现多选项卡

图片说明多个选项卡,可以来回切换,如何用Tkinter实现,谢谢大家了。。。。。。。。。

https://zhidao.baidu.com/question/1703496574796461860.html

http://bbs.csdn.net/topics/392033045?page=1

使用控件Notebook

from tkinter import *
from tkinter.ttk import *

root=Tk()
root.title('try')
root.geometry('400x400')

        

note=Notebook(root,height=150,width=300)

frame1=Frame()
frame2=Frame()

note.add(frame1,text='登录')
note.add(frame2,text='注册')
note.place(x=200,y=110,anchor='c')

entry1_name=Entry(frame1)
entry1_name.place(x=170,y=20,anchor='c')
entry1_pw=Entry(frame1)
entry1_pw.place(x=170,y=50,anchor='c')

entry2_name=Entry(frame2)
entry2_name.place(x=170,y=20,anchor='c')
entry2_pw=Entry(frame2)
entry2_pw.place(x=170,y=50,anchor='c')

button1=Button(frame1,text='登录')
button1.place(x=150,y=90,anchor='c')
button2=Button(frame2,text='注册')
button2.place(x=150,y=90,anchor='c')

label1_name=Label(frame1,text='用户名')
label1_name.place(x=70,y=20,anchor='c')
label1_pw=Label(frame1,text='密码')
label1_pw.place(x=70,y=50,anchor='c')

label2_name=Label(frame2,text='用户名')
label2_name.place(x=70,y=20,anchor='c')
label2_pw=Label(frame2,text='密码')
label2_pw.place(x=70,y=50,anchor='c')

img

我用#CSDN#这个app发现了有技术含量的博客,小伙伴们求同去《tkinter绘制组件(27)——标签栏视图》, 一起来围观吧 https://blog.csdn.net/tinga_kilin/article/details/124525111?utm_source=app&app_version=5.3.1