【发布时间】:2021-09-21 15:17:03
【问题描述】:
对于我需要编写的程序,我需要 Listbox 项目的名称也是标签中的文本。这是我认为可行的代码,但它仅将标签配置为列表框中的项目编号,而不是名称:
def openAccount(self):
selectedItem = ltboxSrcUser.curselection()
for item in selectedItem:
rootMainPage.withdraw()
rootOthAccPage.deiconify()
lblOtherUserName.config(text = ltboxSrcUser.curselection())
谁能帮帮我?
【问题讨论】:
-
你能再分享一些代码吗?另外,
selectedItem = ltboxSrcUser.ACTIVE (ltboxSrcUser.curselection()) -
尝试使用
<tkinter.Listbox>.get(<tkinter.Listbox>.curselection())
标签: python user-interface tkinter listbox label