Solved

DoubleClick event on a Listview in c++

Posted on 2004-08-18
1
619 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Safearray problem c++ 4 92
Can I install VS 6.0 and VS 2005 together? 6 55
SHA256 Code Signing 4 168
a reliable reference for c+11? 3 79
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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