I am developing a WPF application that has a listbox. In a standard windows form when I added an item to a listbox I could just use the TopIndex feature but that is not available in a WPF window.
I have tried ScrollIntoView but I cannot get it to work. Any help would be appreciated.
Thanks!
Public Sub UpdateStatus(ByVal s As String) Dim currDateTime As DateTime = DateTime.Now Dim sDateTime As String If (s <> gsLine) Then sDateTime = currDateTime.ToString("yyyyMMdd-HH:mm:ss> ") Else sDateTime = "" End If listStatus.BeginInit() listStatus.Items.Add(sDateTime + s) listStatus.ScrollIntoView(listStatus.Items.Count - 1) listStatus.EndInit() End Sub
Yeah I am a WPF noob also :). But i got it to work also. I tried using the ScrollViewer several different ways and still couldn't get it to work. I guess I just don't know what I am doing and it is showing!