make tkinter btn disable
btn1['state'] = 'normal'
btn1['state'] = 'disabled'
make tkinter btn disable
btn1['state'] = 'normal'
btn1['state'] = 'disabled'
button state change in tknter
from tkinter import *
fenster = Tk()
fenster.title("Window")
def switch():
if(b1['state']==NORMAL):
b1["state"] = DISABLED
b2["text"]="enable"
elif (b1['state']==DISABLED):
b1["state"]=NORMAL
b2["text"]="disable"
#--Buttons
b1=Button(fenster, text="Button")
b1.config(height = 5, width = 7)
b1.grid(row=0, column=0)
b2 = Button(text="disable", command=switch)
b2.grid(row=0,column=1)
fenster.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us