from tkinter import*
from tkinter import messagebox
def func():
print("暂时无法登录")
def func1():
print("暂时无法注册")
root = Tk()
root.title("登录界面")
root.geometry("600x450")
label = Label(root,text="用户名",font=("黑体",15),fg="black")
entry=Entry(root,font=("宋体",15),fg="black")
label1 = Label(root,text="密码",font=("黑体",15),fg="black")
entry1=Entry(root,font=("宋体",15),fg="black")
button=Button(root,text="登录",font=("黑体",15),fg="black",command=func)
button1=Button(root,text="注册",font=("黑体",15),fg="black",command=func1)
label2 = Label(root,text="登录失败",font=("黑体",15),fg="black")
label.grid(row=0,column=0)
entry.grid(row=0,column=1)
label1.grid(row=1,column=0)
entry1.grid(row=1,column=1)
button.grid(row=2,column=0)
button1.grid(row=2,column=1)
root.mainloop()
效果如图所示?
|