注:不到必须用的时候,我们尽量不用这写代码。因为这样会让我们的代码非法话,频繁使用不利于我们的代码水平。
你已经用frame了,在frame里面放内容,肯定是在里面出现滚动条的,要么你在页面里面加入一段js,动态的设置mainframe的高度,不过最终还是要出现滚动条的,最好是调整你的页面,使其不受滚动条影响你好,tkinter的messagebox
是不可以调整大小的。如果你需要的话,你可以换其他的来实现,下面是一个例子。
from
tkinter
import
*
#If
you
get
an
error
here,
try
Tkinter
not
tkinter
def
Dialog1Display():
Dialog1
=
Toplevel(height=100,
width=100)
#Here
def
Dialog2Display():
Dialog2
=
Toplevel(height=1000,
width=1000)
#Here
master=Tk()
Button1
=
Button(master,
text="Small",
command=Dialog1Display)
Button2
=
Button(master,
text="Big",
command=Dialog2Display)
Button1.pack()
Button2.pack()
master.mainloop()