Open vsfeedback opened 1 month ago
Well the two strings are identical, in this case even the same "instance", how would the ListBox know which one you want it to scroll to?
We could have an API overload that takes an index. (Also if your panel is VirtualizingStackPanel
, it has BringIndexIntoViewPublic
).
This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
Create ListBox "LB"
create one button with lines: LB.Items.Add("SameText"); LB.ScrollIntoView(LB_Status.Items.GetItemAt(LB_Status.Items.Count - 1));
create another button with lines: var rand = new Random(); LB.Items.Add(rand.Next(1000).ToString()); LB.ScrollIntoView(LB_Status.Items.GetItemAt(LB_Status.Items.Count - 1));
->Listbox will scroll to last item only on button 2 (random item values)
.net 8 Preview 5
Original Comments
Alison Jin [MSFT] on 11/1/2023, 08:58 AM:
(private comment, text removed)
Person (2023-10-31 15:34:10Z) on 11/1/2023, 10:43 PM:
(private comment, text removed)
Feedback Bot on 11/6/2023, 00:32 PM:
(private comment, text removed)
Feedback Bot on 2/5/2024, 00:15 PM:
(private comment, text removed)
Original Solutions
(no solutions)
Repro
WPF_Listbox.zip