cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 1753|回复: 5

紧急求助:如何实现当鼠标移到stripchrat上的曲线上时显示曲线的属性

[复制链接]
发表于 2008-7-3 14:32:55 | 显示全部楼层 |阅读模式
如题,我用stipchart控件画的曲线(多条),如何实现当鼠标移到曲线上时显示曲线的一些属性,关键点如何获知鼠标移到曲线上,高手指点一下,先谢谢了
发表于 2008-7-3 22:19:17 | 显示全部楼层
没有CURSOR不好弄!

不知道这样行不行:就是用鼠标在这个控件上面移动的事件,来判断它的坐标,然后再在数据数组中搜索这个坐标对应的Y值,不知道这样行不行!
 楼主| 发表于 2008-7-3 22:40:28 | 显示全部楼层
能获得鼠标的在stripchart上的坐标吗
发表于 2008-7-4 08:46:41 | 显示全部楼层
可以的!用这个函数:

Obtains information about the state of the mouse cursor. xCoordinate and yCoordinate return the position of the mouse relative to the top and left coordinates of a specific control. If you pass zero as the controlID, the coordinate information references the top and left coordinates of the panel, excluding the panel frame and title bar. GetRelativeMouseState returns the coordinates even if the mouse is not over the control or the panel.



Prototype

int GetRelativeMouseState (int Panel_Handle, int Control_ID, int *XCoordinate, int *YCoordinate, int *Left_Button_Down, int *Right_Button_Down, int *Key_Modifiers);
 楼主| 发表于 2008-7-4 09:37:25 | 显示全部楼层
我怎么感觉不行呢,这个是相对control的位置吧,也不是坐标
发表于 2008-7-7 22:12:12 | 显示全部楼层
是相对Contrl的
所以需要GetCtlAttr,获得left,hight值
然后再相减,再与x轴的比例进行比较,
最后起始点比较
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-4-22 01:20 , Processed in 1.335252 second(s), 6 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表