Double-click event in ListView and double-click event in listview
1 Private Sub lstShowRunning_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstShowRunning.MouseDoubleClick 2 Try 3 If lstShowRunning.SelectedItems.Count > 0 Then 4 If lstShowRunning.SelectedItems(0).ToolTipText <> "" Then 5 Using frmMsg As New frmMessage(lstShowRunning.SelectedItems(0).ToolTipText) 6 frmMsg.ShowDialog() 7 End Using 8 End If 9 10 End If11 Catch12 Try13 If lstShowRunning.SelectedItems.Count > 0 Then14 MessageBox.Show(lstShowRunning.SelectedItems(0).ToolTipText)15 End If16 Catch17 End Try18 End Try19 End Sub20 End Class
For the subitems double-click event of listview in C #,
Private void listView1_DoubleClick (object sender, EventArgs e)
{
If (listView1.SelectedItems. Count = 0) return;
MessageBox. Show ("You clicked" + listView1.SelectedItems [0]. Text );
}
Double-click event of ListView control in MFC
No ListView. Is it a List Control?
Double-click will generate the NM_DBCLICK message.
You can choose View> ClassWizard from the menu. On the displayed Class management interface, select the Class Name of your List Control, select the List Control ID in the Object IDs, and select NM_DBCLICK in Messages on the right to add the message.