紧急求助:如何实现当鼠标移到stripchrat上的曲线上时显示曲线的属性
如题,我用stipchart控件画的曲线(多条),如何实现当鼠标移到曲线上时显示曲线的一些属性,关键点如何获知鼠标移到曲线上,高手指点一下,先谢谢了 没有CURSOR不好弄!不知道这样行不行:就是用鼠标在这个控件上面移动的事件,来判断它的坐标,然后再在数据数组中搜索这个坐标对应的Y值,不知道这样行不行! 能获得鼠标的在stripchart上的坐标吗 可以的!用这个函数:
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); 我怎么感觉不行呢,这个是相对control的位置吧,也不是坐标 是相对Contrl的
所以需要GetCtlAttr,获得left,hight值
然后再相减,再与x轴的比例进行比较,
最后起始点比较
页:
[1]