在Listbox中如何設定使用雙擊或者鍵盤上的Delete鍵洗掉選中的某項
uj5u.com熱心網友回復:
首先定義一個函式:def delete_the_line(*args):
listBox_1.delete(first=listBox_1.curselection(),last=None) #洗掉listbox中選中的內容
然后再你設定的listbox控制元件系結一個雙擊滑鼠的事件:
listBox_1.bind('<Double-Button-1>',delete_the_line) #此命令指雙擊滑鼠后,呼叫函式delete_the_line,然后執行洗掉命令
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/132438.html
上一篇:求大神賜教!!!!
