MFC c++ list control of report style is not notifying double click event | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

MFC c++ list control of report style is not notifying double click event

Hi I have control called idc_list as list control on dialogue... I am doing ddx_control with above idc_list and have ClistCtrl mylist... I have set message map for On_Lbn_dblclk(idc_list,&myfun); I have just message box in my fun which is not triggered when I double click on list... Also I have used ListView_Setview(mylist,LBS_Notify); Not able to catch double click event... Plz help me on this...

24th Aug 2020, 5:18 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
7 Answers
+ 1
as i remember you nees add in message map of dialog cpp fillowing. ON_NOTIFY(DBL_CLICK,<id of list>, <function>) but if you need more detailes i can check it function should be folowing void blablabla(NMHDR* p, LRESULT* lr){ ... ... *lr=0} name of function as you like, add your code before *lr=0. NMHDR is a structure contained usefull info, check it please in MSDN of Microsoft.com
25th Aug 2020, 7:24 PM
george
george - avatar
+ 1
This is not a solution, rather a reminiscence, I slightly recall ListView_* was meant for a ListView control. Not sure you were using a ListView or another type of List control. Also IIRC constant LB* was used for a ListBox control rather than a ListView. Good luck anyways Ketan Lalcheta 👍
24th Aug 2020, 5:33 PM
Ipang
+ 1
Hi Ipang do you mean to say that ClistCtrl type of mylist should be other than the one I used ? If so, I used this to identify the number of rows present into list... ClistBox I guess was not working for the finding out the rows present in list.
24th Aug 2020, 6:27 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
No that's not what I meant Ketan Lalcheta I just remember slightly that ListView_* macro functions were used to make adjustments on a ListView control (CListView), and I noticed you used CListCtrl. So I think ListView_Setview wouldn't work because the control was different. It's been too long since I studied MFC so please don't mind my note all too far, I was just getting that feeling about what I wrote. Better wait for others' opinions who are more knowledgeable I guess bro ...
24th Aug 2020, 6:48 PM
Ipang
+ 1
No problem Ipang ... I appreciate that you respond with what all you know... Many thanks... And yes , I got now what you mean to say... You mean to say that listview_setview is not working because my control is of other type... I set grid property on same control type using listview_setextendedproperty and it is working...don't know what is wrong with listview_setview
24th Aug 2020, 6:54 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
As I remember, ListView_Setview was meant to change a CListView item layout (tile, list, details etc.) Like the options in Windows Explorer file manager views. I don't know why it works with the grids either unfortunately, maybe the constant used as extended style have similar values (just a wild guess). Anyways, nice to get it to work 👍
24th Aug 2020, 7:05 PM
Ipang
0
Thanks george ...it worked... I was trying with other macro like lvs_***
25th Aug 2020, 9:08 PM
Ketan Lalcheta
Ketan Lalcheta - avatar