Solved

DoubleClick event on a Listview in c++

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I tell if an app is 32 or 64 bit? 7 144
help with SQL 15 116
Cchar * Concating 7 89
C# - Function parentheses 11 51
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now