Untitled

 avatar
unknown
plain_text
5 months ago
2.2 kB
2
Indexable
import tkinter as tk
from tkinter import messagebox

def register():
    messagebox.showinfo("Success", "Registration Successful")

root = tk.Tk()
root.title("Register")
root.geometry('700x700')
root.resizable(True, False)

lbl = tk.Label(root, text='Student Registration', bg='yellow', fg='black', font=('Times New Roman', 20))
lbl.pack(ipadx=10, ipady=10)

lb2 = tk.Label(root, text='Student Name:', fg='black', font=('Times New Roman', 15))
lb2.place(x=500, y=100)
tx1 = tk.Entry(root)
tx1.place(x=650, y=100, width=300, height=30)

lb3 = tk.Label(root, text='Father\'s Name:', fg='black', font=('Times New Roman', 15))
lb3.place(x=500, y=150)
tx2 = tk.Entry(root)
tx2.place(x=650, y=150, width=300, height=30)

lb4 = tk.Label(root, text='Gender:', fg='black', font=('Times New Roman', 15))
lb4.place(x=500, y=200)
rad_var = tk.IntVar()
rd1 = tk.Radiobutton(root, text='Male', variable=rad_var, value=1)
rd1.place(x=650, y=200)
rd2 = tk.Radiobutton(root, text='Female', variable=rad_var, value=2)
rd2.place(x=750, y=200)

lb5 = tk.Label(root, text='Languages Known:', fg='black', font=('Times New Roman', 15))
lb5.place(x=500, y=250)
chk1_var = tk.IntVar()
ch1 = tk.Checkbutton(root, text='English', variable=chk1_var, onvalue=1, offvalue=0)
ch1.place(x=675, y=250)
chk2_var = tk.IntVar()
ch2 = tk.Checkbutton(root, text='Hindi', variable=chk2_var, onvalue=1, offvalue=0)
ch2.place(x=775, y=250)
chk3_var = tk.IntVar()
ch3 = tk.Checkbutton(root, text='Marathi', variable=chk3_var, onvalue=1, offvalue=0)
ch3.place(x=675, y=275)

lb6 = tk.Label(root, text='Address:', fg='black', font=('Times New Roman', 15))
lb6.place(x=500, y=325)
tx3 = tk.Entry(root)
tx3.place(x=650, y=325, width=300, height=70)

lb7 = tk.Label(root, text='Mobile No.:', fg='black', font=('Times New Roman', 15))
lb7.place(x=500, y=400)
tx4 = tk.Entry(root)
tx4.place(x=650, y=400, width=150, height=30)

b1 = tk.Button(root, text="Submit", bg='red', fg='white', activebackground='black', activeforeground='white', highlightbackground='#3E4149', command=register)
b1.place(x=700, y=450)

root.configure(bg='bisque1')
root.mainloop()
Editor is loading...
Leave a Comment