如何在listctrl报告屏幕中获取记录的信息。 [英] How do I get the informations of a record in the listctrl report screen.

查看:96
本文介绍了如何在listctrl报告屏幕中获取记录的信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ListCtrl报告样式屏幕的显示中,我想获取我点击或双击的任何行的信息。



有人建议我使用最简单的ListCtrl,我可以看到非常罕见的例子。

直接说,当我点击ListCtrl的屏幕时,我想知道鼠标的位置,名称,年龄,一个记录信息的地址包括行索引和列序列。



谢谢



我尝试过:



这是我项目的长期痛苦。一个键可以解决很多锁。

In the show of the ListCtrl report style screen, I want to get the informations of any row which I click or double clicking.

Someone advised me to use tictest of ListCtrl, I can see very rare examples about it.
Directly speaking, When I clicked the screen of ListCtrl, I want to know the position of mouse, name,age, addresses of one record informations including the row index and column sequences.

Thank you

What I have tried:

This is very long suffering of my projects. One key may solve many locks.

推荐答案

处理NM_CLICK(列表视图)通知代码(Windows) [ ^ ]和 NM_DBLCLK(列表视图)通知代码(Windows) [ ^ ]父窗口中的通知消息。



这些消息的 LPARAM 参数是指向 NMITEMACTIVATE结构(Windows) [ ^ ]包含所有必要信息(点击行)索引,鼠标位置)。



如果您还需要点击发生的列索引,请发送LVM_SUBITEMHITTEST消息(Windows) [ ^ ]到列表控件。



然后可以通过访问列表控件项来简单地检索列的内容。
Handle the NM_CLICK (list view) notification code (Windows)[^] and NM_DBLCLK (list view) notification code (Windows)[^] notification messages in your parent window.

The LPARAM parameter for these messages is a pointer to a NMITEMACTIVATE structure (Windows)[^] containing all necessary information (clicked row index, mouse position).

If you also need the column index where the click occured, send a LVM_SUBITEMHITTEST message (Windows)[^] to the list control.

The content of the columns can then be simply retrieved by accessing the list control items.


这篇关于如何在listctrl报告屏幕中获取记录的信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆