Solved

DoubleClick event on a Listview in c++

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Client socket stops responding on client 9 60
Visual c++ problem with command line conflicts 22 196
Tab order 16 79
vb.net - How to check if current user is an administrator? 6 55
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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