Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [Tkinter] How to show and hide tkinter entry box when select yes from drop down
#1
Hi,

i have created an entry form for personal use using tkinter. Now i want to add a function in it that when yes if select from drop down show entry box otherwise hide it.

i have written the codes but it is not working neither
throwing the error below is the snippet of my code
field = ["YES",""]
query_text = StringVar()
lblname = Label(f1aa, font=("arial", 10, "bold"), text="Query/Reply", bd=8, anchor="w")
lblname.grid(row=0, column=0, sticky=W)
txtname28 = OptionMenu(f1aa, query_text, *field)
txtname28.grid(row=0, column=1, sticky=W)
    
hidden = False
hidden_text = StringVar()
e = Entry(f1aa, font=("arial", 10, "bold"), bd=8, justify="left", textvariable = hidden_text)
e.grid(row=0, column=2)
    
if query_text == "YES":
    e.grid()
else:
    e.grid_remove()
#hidden = not hidden
Quote
#2
use lift and lower to hide widgets
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Can't Get Entry Var in Tkinter OCaraDoBaixo 1 498 Feb-18-2020, 06:08 PM
Last Post: Larz60+
  [Tkinter] Getting Input from Tkinter Entry juliabrushett 4 10,034 Feb-13-2020, 12:12 AM
Last Post: reblark
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 913 Jan-23-2020, 09:00 PM
Last Post: HBH
  Newbie question with Tkinter Entry mariolopes 2 249 Oct-12-2019, 11:02 PM
Last Post: Larz60+
  [Tkinter] How to get the result of a ping to show in tkinter? jacklee26 5 1,234 Jun-15-2019, 08:50 PM
Last Post: Yoriz
  [Tkinter] how to get the entry information using Entry.get() ? SamyPyth 2 842 Mar-18-2019, 05:36 PM
Last Post: woooee
  General help with hide show status bar for a begineer in python ArakelTheDragon 0 495 Mar-17-2019, 11:58 AM
Last Post: ArakelTheDragon
  Hide button when clicked frequency 2 1,076 Dec-24-2018, 02:10 PM
Last Post: frequency
  [PYQT5] Crashing when using .hide() and .show() aking76 0 2,490 Sep-18-2018, 02:09 PM
Last Post: aking76
  [Tkinter] Tkinter Entry widget and KeyPad intrgration chiragarya1992 0 1,802 Aug-11-2018, 01:09 AM
Last Post: chiragarya1992

Forum Jump:


Users browsing this thread: 1 Guest(s)