Solved

DoubleClick event on a Listview in c++

Posted on 2004-08-18
1
616 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
1 Comment
 
LVL 19

Accepted Solution

by:
drichards earned 25 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

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