April 27, 2024, 09:01:05 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Listview row selected question.

Started by Rock Ridge Farm (Larry), January 12, 2006, 06:24:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rock Ridge Farm (Larry)

In my almost completd first program I need to return the data from the row I mouse click on. I found how to do a column but have not found how to return the data in
a single cell.
Also is there a way to clear a list of data so that it can be reused for other data?

Zen

Here you go. As promised...


if(code = 0xFFFFFFFE)
{
MessageBox(this,pList->GetItemText(*(NMLISTVIEW)pnmhdr.iItem,1),pList->GetItemText(*(NMLISTVIEW)pnmhdr.iItem,0));
}


This basicly listens for the NMCLICK message which has not yet been added to the GUI library so just use 0xFFFFFFFE for now or #define NMCLICK 0xFFFFFFFE.

The function then returns the item you clicked on, then gets the text of the item and the text of the sub item as you can see from the message box.

Hope this helps.
Lewis

Zen

The code above was taken from where i added it in the listview.src program in the aurora examples folder. Simply put it in the OnNotify section if you cant figure out how to get it working.

Lewis

Rock Ridge Farm (Larry)


Rock Ridge Farm (Larry)

Now for my next question - I have 3 listviews open - how can I tell which one the
mouse event was in?

Zen