WebIt seems to be a bug, see Fix SplitButton SelectedIndex and SelectedItem #1798. As workaround you could try to override default value for SplitButton.SelectedIndexProperty. SplitButton.SelectedIndexProperty.OverrideMetadata(typeof(SplitButton), new FrameworkPropertyMetadata(-1)); Put it to the some static constructor, which will be called. WeblistBox.TopIndex=listBox.Items.Count-1 我更喜欢这个更简单的解决方案。谢谢最佳解决方案,我的列表框没有 TopIndex 属性(不知道为什么),设置 SelectedIndex 不会滚动到所 …
bind the SelectedIndex proprerty of a listbox
WebAug 20, 2012 · Hi Robert, You use like this, private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e) { //To get the Selected Index of the ListBox MessageBox.Show("The Selected Index is" + listBox1.SelectedIndex); //To get the selected ListItem ListBoxItem item = … WebNov 11, 2011 · 1 solution Solution 1 using listbox.SelectedItem = object to hightlight in the list. or listbox.SelectedIndex = numeric index of the item you want highlighted. Posted 11-Nov-11 7:38am Tim Groven Add your solution here … I have read and agree to the Terms of Service and Privacy Policy Please subscribe me to the CodeProject newsletters banner para sala de aula
Listbox problem selectedindex C# - CodeProject
WebC# 如何将选定的ListBox1项复制到同一索引处的ListBox2列表?,c#,listbox,selecteditem,selectedindex,C#,Listbox,Selecteditem,Selectedindex,我 … Web我有一個 ListBox,我想為列表中的每個項目添加一個上下文菜單。 我已經看到“解決方案”讓右鍵單擊選擇一個項目並在空白處取消上下文菜單,但是這個解決方案感覺很臟。 有人 … WebApr 26, 2011 · As it stands right now, the user first has to select the row then click the checkbox. Clicking directly on the checkbox does not change the selected row. I would like the row to be selected when the checkbox is checked so that I can access the SelectedIndex property for the checked checkbox. Thanks, rgames Monday, April 25, … banner pangkas