Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は自分のアプリケーションをWPFに統合しています。私のコードでは、ListBox.SetSelected(i, true);を表示するために使用しました。Selected Itemsで正常に動作しますWindow Applicationが、では動作しませんWPF。前もって感謝します
ListBox.SetSelected(i, true);
Selected Items
Window Application
WPF
まず、そのセットSelection modeをする必要がありますList box。次に、選択したアイテムにアイテムを追加します。以下に示すように。
Selection mode
List box
listBox.SelectionMode = SelectionMode.Multiple; listBox.SelectedItems.Add(seltectedItem1); listBox.SelectedItems.Add(seltectedItem2);