社区
VB基础类
帖子详情
谁用过listview的hittest,怎么用啊
bruce_ldw
2001-06-29 03:05:28
...全文
86
1
打赏
收藏
谁用过listview的hittest,怎么用啊
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
pp616
2001-06-29
打赏
举报
回复
Returns a reference to the ListItem object or Node object located at the coordinates of x and y. Used with drag and drop operations.
看的懂吧。
Multiline balloon tooltips on
ListView
items
Description: The attached code demonstrates a technique you can use to create multiline balloon tooltips for
ListView
items.The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the
ListView
control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer.To determine the index of the list-view item under the mouse pointer, we send the LVM_
HITTEST
message to the
ListView
control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LV
HITTEST
INFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels.This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for
ListView
and FlexGrid
C#
ListView
双击Item事件
代码如下:private void
listView
右侧_MouseDoubleClick( object sender , MouseEventArgs e ) {
ListView
HitTest
Info info =
listView
右侧.
HitTest
(e.X , e.Y); if( info.Item != null ) { MessageBox.Show (info.Item.Text); } } 您可能感兴趣的文章:C# Winform 禁止用户调整
ListView
的列宽c#数据绑定之将datatabel的data添加listVi
TreeView控件拖动Node至其他Treeveiw
关于
HitTest
方法(
ListView
和 TreeView 控件)示例
10tec公司将多行气球工具提示添加到列表列标题已更新__1-44312
将多行气球工具提示添加到
ListView
列标题(已更新) 描述 该代码使用子类化技术来捕获Header控件的WM_MOUSEMOVE事件,该事件是
ListView
控件的组成部分。 此事件的处理程序确定鼠标指针下列标题的索引,并分别更改工具提示文本。 为此,它使用HDM_
HITTEST
消息。 若要从MSCOMCTL.OCX在
ListView
中查找Header控件的句柄,该代码使用FindWindowEx函数,该函数使用
ListView
控件中的“ msvb_lib_header”类搜索子窗口。 更多信息 该代码还可以用于子类化“纯”
ListView
控件(其类名称为“ Sys
ListView
32”)。 为此,必须替换“ SysHeader32”上的“ msvb_lib_header”字符串。 该示例使用CreateWindowEx函数创建MS Windows工具提示,并将“ tooltip
VB中
HitTest
方法的应用
很久没有用过VB6了,最近有人问到一些问题,所以在这里回忆一下
HitTest
方法, 在指定的屏幕坐标位置检索子对象。(这个解释是.net下说明,VB6下应该一样的,有什么问题的话朋友们可以回贴告诉我) 在VB6两个用的比较多的控件:
ListView
TreeView,如果我们通过鼠标移动来获取当前位置的内容,可以利用控件中
HitTest
方法来获取。下面例子是个显示鼠标位置提示信息,有兴趣...
VB基础类
7,763
社区成员
197,609
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章