Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Listview selected item

Posted on 2014-02-26
1
Medium Priority
?
391 Views
Last Modified: 2014-02-26
Hello,

Can anyone tell me how with a list view you can click the selected item and execute a command such as open a form ?
0
Comment
Question by:lincstech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39888155
First set the MultiSelect property to False, then you can simply react to the Click event and retrieve the lonely item in the Items collection:

      Private Sub ListView1_Click(sender As Object, e As EventArgs) Handles ListView1.Click
            If ListView1.SelectedItems(0).Text = "YourItem" Then
                  'Do what you want
            End If
      End Sub
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Six Sigma Control Plans
Progress

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question