?
Solved

DoubleClick event on a Listview in c++

Posted on 2004-08-18
1
Medium Priority
?
631 Views
Last Modified: 2006-11-17
Hi,

I'm kind of new in the C++ world and I have to do a software with a listview. I want to raise something when the user doubeclick on one item in the list.

Thats the code I have used to test the event:

private: System::Void lstView_DoubleClick(System::Object * sender, System::EventArgs * e)
             {
                  label1->Text=S"Works!";
             }

I have 2 items in the listview, and when I doubleclick on one of them, it doesn't raise the event and its not working.

What I have done wrong??
0
Comment
Question by:e_poirier
[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 19

Accepted Solution

by:
drichards earned 100 total points
ID: 11836400
Is there a line that looks like this in InitializeComponents?

    this->listView1->DoubleClick += new System::EventHandler(this, listView1_DoubleClick);

I used this code:

    label1->Text = listView1->SelectedItems->Item[0]->Text;

in the handler method and it works fine.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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