以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  高级功能研发区  (http://www.weistock.com/bbs/list.asp?boardid=5)
----  怎么利用MouseDown得到的x轴坐标得到对应k线图上的正序或逆序号  (http://www.weistock.com/bbs/dispbbs.asp?boardid=5&id=97142)

--  作者:逸飞
--  发布时间:2016/5/6 15:57:48
--  怎么利用MouseDown得到的x轴坐标得到对应k线图上的正序或逆序号
我的本意是利用MouseDown事件获得光标所在位置的x轴对应时间。

另外,如何在该事件代码执行过程中判定键盘状态,比如判定点击鼠标的时候ctrl键是否按下。


--  作者:jinzhe
--  发布时间:2016/5/6 15:59:36
--  

MouseDown

这个是哪里的函数?


--  作者:逸飞
--  发布时间:2016/5/6 16:02:39
--  
Grid事件中的:


Sub mfd_MouseDown(Button, Shift, x, y)
Set Grid = mfd.GetGridByName("Window4")
Set dstGrid = mfd.GetGridByName("Window2")
Application.MsgOut ": " & x & "---" & y

End Sub

这段代码可以正确输出窗格内部x、y坐标。

--  作者:jinzhe
--  发布时间:2016/5/6 16:15:00
--  
VBA么?这个需要在高级研发区发帖
--  作者:逸飞
--  发布时间:2016/5/6 16:20:59
--  
哦,抱歉发错版块了,我该麻烦管理员移动帖子还是重发呢?谢谢管理员~
--  作者:yukizzc
--  发布时间:2016/5/9 9:26:44
--  

dim n
Sub technic_MouseDown(Button, Shift, x, y)
 dim Date
    dim Values
    Set Grid = technic.GetGridByName("main")
    call Grid.ValueByPoint(x, y, Date, Price,True)
    Application.MsgOut ": " & Date & "---" & Price
    application.MsgOut n
End Sub
sub Technic_KeyDown(KeyCode, Shift)
if KeyCode = 17 then
 n=1
 end if
end sub

sub Technic_KeyUp(KeyCode, Shift)
if KeyCode = 17 then
 n=0
 end if
end sub


--  作者:逸飞
--  发布时间:2016/5/9 19:56:45
--  
哈哈,这样用变量来传递按键状态很妙,谢谢超版!