# .NET and More > WPF, WCF, WF >  Listview get select item text on double click (WPF)

## xx7xx

I am trying to get the text from the first column of the listview row when I double click it.  How can this be done.

----------


## xx7xx

Hi Edgemeal,

Thx for the response! I forgot to note that I'm using WPF, not WinForms.  Is there an easy way to convert this?

----------


## dee-u

Try this


```
Private Sub listview1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles listview1.MouseDoubleClick

        'MsgBox(listview1.SelectedItem.ToString())

        Dim clickedSong As Song
        Dim dep As DependencyObject = CType(e.OriginalSource, DependencyObject)
        Do While dep IsNot Nothing AndAlso Not TypeOf (dep) Is ListViewItem
            dep = VisualTreeHelper.GetParent(dep)
        Loop
        If dep Is Nothing Then
            Return
        Else
            clickedSong = CType(Me.listview1.ItemContainerGenerator.ItemFromContainer(dep), Song)
            MessageBox.Show(clickedSong.Company)
        End If
    End Sub
```

----------


## si_the_geek

Welcome to VBForums  :wave: 

_Thread moved from the 'VB.Net' forum to the more specific 'WPF, WCF, WF' forum_

----------


## xx7xx

Thanks, that works great!  :Smilie:

----------

