VB如何判断鼠标移动方向?
解决方案 »
- 连接数据库方面
- vb中插入图片怎么显示 “内存不足”
- VB6.0 做的ActiveX OCX控件,给其他语言调用,发现字符串传递问题
- form hide后再show,picture控件还原了怎么办?
- 水晶报表乱码问题(报表高手快来帮忙)
- MSFlexGrid简单的小问题???
- 关于COM+组件连接的问题,请来帮帮忙~~
- 怎样给VB菜单加背景?使做出的菜单不再是单调的灰色!哪位高手指点迷津?
- 百思不得其解,就这些分了,全部给高手求解
- 对了,兄弟们,问一个问题,如果用VB做一个大型数据库软件,何如?VB何如?可行吗?过几天,兄弟我就会给分的。
- 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
- eval 为什么不能执行 变量
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Dim OldXY As POINTAPI
Dim NowXY As POINTAPI
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Dim lngP As Long
Timer1.Interval = 100
lngP = GetCursorPos(OldXY)
lngP = GetCursorPos(NowXY)
End SubPrivate Sub Timer1_Timer()
Dim lngP As Long
Dim strP As String
lngP = GetCursorPos(NowXY)
If OldXY.x - NowXY.x > 0 Then
strP = "向左平移;"
ElseIf OldXY.x - NowXY.x = 0 Then
Else
strP = "向右平移;"
End If
If OldXY.y - NowXY.y > 0 Then
strP = strP & "向上移动;"
ElseIf OldXY.y - NowXY.y = 0 Then
Else
strP = strP & "向下移动;"
End If
If strP <> "" Then Me.Caption = strP
lngP = GetCursorPos(OldXY)
End Sub