by Jom07 » 01/03/2018 2:15 pm
การใช้งาน Python GUI (Tkinter) : Grid (กำหนดตำแหน่ง grid) เป็นการกำหนดตำแหน่งไม่ว่าจะเป็นปุ่ม ตัวหนังสือ หรือช่องใช่ข้อมูลสามารถกำหนดตำแหน่งโดยใช้ Grid เช่น
ตัวอย่าง
Code: Select all
from tkinter import *
root = Tk()
root.title('Grid')
lable_1 = Label(root, text="Name")
lable_2 = Label(root, text="Password")
entry_1 = Entry(root)
entry_2 = Entry(root)
lable_1.grid(row=0)
lable_2.grid(row=1)
entry_1.grid(row=0, column=1)
entry_2.grid(row=1, column=1)
root.mainloop()
ผลรัน

การใช้งาน Python GUI (Tkinter) : Grid (กำหนดตำแหน่ง grid) เป็นการกำหนดตำแหน่งไม่ว่าจะเป็นปุ่ม ตัวหนังสือ หรือช่องใช่ข้อมูลสามารถกำหนดตำแหน่งโดยใช้ Grid เช่น
[b]ตัวอย่าง[/b]
[code]from tkinter import *
root = Tk()
root.title('Grid')
lable_1 = Label(root, text="Name")
lable_2 = Label(root, text="Password")
entry_1 = Entry(root)
entry_2 = Entry(root)
lable_1.grid(row=0)
lable_2.grid(row=1)
entry_1.grid(row=0, column=1)
entry_2.grid(row=1, column=1)
root.mainloop()
[/code]
[b]ผลรัน[/b]
[img]http://snap.mindphp.com/index.php?view=2018Mar01_5a97a586af29f[/img]