Tkinter disable button after click


If it is set to DISABLED to make the button unresponsive. 
ACTIVE represents the active state of the button.


******Your code Below*****

from tkinter import *

root= Tk()
root.title("Disable Button After Clcik")
root.config(background="#FFF8DC")
root.geometry("900x500+350+86")

def changestate():
btn['text']='Button Go to Disabled'
btn['state']='disabled'

btn= Button(root, text="Button In Normal State",font=("Times", 30, "bold"),padx=50,pady=20,command=changestate)
btn.pack(pady=80)

root.mainloop()

********End Code**********


Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.



Enjoy..............


If You Want To Learn More Plz Visit www.newpost24.com

If You Find Specific link plz Follow This Page.

Post a Comment

أحدث أقدم