1. 程式人生 > 其它 >tkinter-訊息框和按鈕背景影印

tkinter-訊息框和按鈕背景影印

技術標籤:tkintertkinter

訊息框`

from tkinter.messagebox import *

showinfo(title="訊息框標題", message="訊息框內容")

按鈕背景顏色

from tkinter import *

py = Tk()

b1 = Button(py,text = "hello")
b1["width"] = 20
b1["height"] = 4
b1.pack()

b2 = Button(py,text = "word"
) b2["width"] = 20 b2["background"] = "white" b2.pack() py.mainloop()