以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助,在Keydown事件中,点击鼠标左键执行事件应如何写代码?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=4820)

--  作者:baoxyang
--  发布时间:2009/10/30 13:36:00
--  求助,在Keydown事件中,点击鼠标左键执行事件应如何写代码?
在Keydown事件中,点击鼠标左键
if e.KeyCode = Keys.LButton then
Dim dr as Row = Tables("员工选择_Table1").Current \'获得选定行
      If dr Is Nothing Then
         Return
      End If
      dr.checked = true
End if

--  作者:baoxyang
--  发布时间:2009/10/30 13:37:00
--  

上面代码不执行不知错在哪?请各位指点!


--  作者:blackzhu
--  发布时间:2009/10/30 14:00:00
--  
if e.KeyCode = Keys.LButton then
Dim dr as Row = Tables("员工选择_Table1").Current \'获得选定行
      If dr Is Nothing Then
         Return
      End If  (是不是要改成Else)
      dr.checked = true
End if
  意思是不是如果为空的话,返回!否则执行!

--  作者:baoxyang
--  发布时间:2009/10/30 14:05:00
--  
是的,关键是点左键不执行,如果Keys.LButton 改成Keys.F1时,按F1键可执行到正确结果,
--  作者:狐狸爸爸
--  发布时间:2009/10/30 14:45:00
--  
鼠标应该用mousedown
--  作者:baoxyang
--  发布时间:2009/10/30 16:23:00
--  
以下是引用狐狸爸爸在2009-10-30 14:45:00的发言:
鼠标应该用mousedown

在表(sql table)中根本没有mousedown 事件呀


--  作者:baoxyang
--  发布时间:2009/10/30 17:10:00
--  
在帮助中可查到Keys枚举类型有LButton呀,难道Keys枚举中参数说明有错误。否则会误导。
--  作者:baoxyang
--  发布时间:2009/10/31 9:36:00
--  

建议在表事件中加上mousedown及mouseup事件。