If I have a listview control in report mode, how could I stick a syslink control into one of the columns?
I want to have a link the user can click in one of the columns.
If I have a listview control in report mode, how could I stick a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The listview control doesn’t support this itself.
You could create a real Syslink control that’s a child of the listview. You would need to sub-class the listview and reposition the Syslink control whenever the list scrolls (watch for WM_HSCROLL / WM_VSCROLL messages) or when items are added or removed, or when it’s sorted. You can use LVM_GETSUBITEMRECT to find out where to position it.
Alternatively, you could handle it yourself by using NM_CUSTOMDRAW to display the “link” in a different color, and handle NM_CLICK to catch when the user clicks on the link. This would be the simplest method in my opinion. Note that if you want a hand cursor to be displayed over the link you would still need to sub-class the list and handle WM_SETCURSOR yourself.