Double-click event in ListView and double-click event in listview

Source: Internet
Author: User

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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.