-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathGUI-Knowledge.py
More file actions
30 lines (25 loc) · 1.3 KB
/
GUI-Knowledge.py
File metadata and controls
30 lines (25 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from tkinter import *
from tkinter import ttk #theme of tk
from tkinter import messagebox
GUI = Tk() # นี่คือหน้าจอหลักของโปรแกรม
GUI.title('โปรแกรมบันทึกข้อมูล') #นี่คือชื่อโปรแกรม
GUI.geometry('500x400') #นี่คือขนาดโปรแกรม
L1 = Label(GUI,text='โปรแกรมบันทึกความรู้',font=('Angsana New',30),fg='green')
L1.place(x=30,y=20)
####################
def Button2():
text = 'ตอนนี้มีเงินในบัญชีอยู่ 300 บาท'
messagebox.showinfo('เงินในบัญชี',text)
FB1 = Frame(GUI) #คล้ายกระดาน
FB1.place(x=100,y=80)
B2 = ttk.Button(FB1,text='เงินมีอยู่กี่บาท',command=Button2)
B2.pack(ipadx=20,ipady=20)
####################
def Button3():
text = 'Python 101, Math'
messagebox.showinfo('วิชาเรียนวันที่ 10-20 ก.พ.',text)
FB2 = Frame(GUI) #คล้ายกระดาน
FB2.place(x=100,y=180)
B3 = ttk.Button(FB1,text='สัปดาห์เรียนวิชาอะไร',command=Button3)
B3.pack(ipadx=20,ipady=20)
GUI.mainloop()