Selecting a Textbox Item in a Listbox does not change the selected item of the listbox

后端 未结 15 1413
清酒与你
清酒与你 2020-11-27 04:10

I Have a wpf Listbox that display\'s a list of textboxes. When I click on the Textbox the Listbox selection does not change. I have to click next to the TextBox to select th

15条回答
  •  甜味超标
    2020-11-27 05:04

    Try this code:

    foreach (object item in this.listBox1.Items) {
        if (textbox1.text.equals(item.toString())) {
            //show error message; break
        }
    }
    

提交回复
热议问题