I would like to get the 'real' Y-value of the point i clicked on when scrolled down a listview.
Here is the XAML:
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" MaxHeight="350" MinHeight="350" Width="525">
<Grid>
<ListView Name="MyListView" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
</ListView>
</Grid>
</Window>
and here the code:
Class MainWindow
Sub New()
InitializeComponent()
For i As Integer = 0 To 100
MyListView.Items.Add(i)
Next
End Sub
Private Sub MyListView_MouseLeftButtonUp(sender As Object, e As MouseButtonEventArgs) Handles MyListView.MouseLeftButtonUp
MsgBox(e.GetPosition(MyListView).Y)
End Sub
End Class
My problem now is that no matter how far down I scrolled, the top is always 1 and the bottom is always 309, but when scrolled down i would like to get values higher than 309. Is there any way to find out the 'real' Y-coordinate I clicked on or maybe find out how far down I scrolled and then being able to calculate the adjusted value? Wrapping the listview in a scrollviewer control is not an option btw.
Thanks for any answers