急
解决了马上给分
解决了马上给分
解决方案 »
- vb6向crystal reports 传递参数
- 如何判断一个数组中的元素是否都在另外一个数组中存在聂?
- 程序编译不成功
- 怎样实现从一个库里把一个关系复制到另一个库里
- 如何使用api得到文件属性中的日期 菜菜地问 20块钱
- 关于在程序运行中在窗体上自动添加文本框控件的问题,在线期待!!!!!!
- 有关WINSOCK控件的初级问提?请个位高手来看一下!
- VB写键盘记录的程序(要源代码)
- 话吧记费软件该如何下手?
- 请问在VB中如何根据一个汉字而得到这个汉字的拼音?谁知道...
- 两个关于网页内嵌入控件开发的问题:1。如何开发没有界面的控件?2。控件打包供网页下载时应该不需要增加VB RUNTIME运行库包吧?
- 如何上下移动treeview的节点?
MsgBox "怎么动鼠标了?X=" & X & ",Y=" & Y, vbQuestion + vbOKOnly
End Sub
If Button = 1 Then MsgBox "您单击了鼠标左键" & vbCrLf & " X=" & X & ",Y=" & Y
If Button = 2 Then MsgBox "您单击了鼠标右键" & vbCrLf & " X=" & X & ",Y=" & Y
End Sub
具体代码用northwolves(野性的呼唤)的。
x As Long
y As Long
End Type
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H8Public Sub SetFormTopmost(TheForm As Form)
SetWindowPos TheForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOZORDER + SWP_NOMOVE + SWP_NOSIZE
End Sub
Dim z As POINTAPI
Public fx
Public fy
Public a
Private Sub Form_Load()
Form1.Left = 200
Form1.Top = 200
fx = 1
fy = 1
a = 1
End SubPrivate Sub Timer1_Timer()
GetCursorPos z
If Form1.Left < z.x * 200 / 13 Then
fx = 1
End If
If Form1.Top < z.y * 200 / 13 Then
fy = 1
End If
If Form1.Left > z.x * 200 / 13 Then
fx = -1
End If
If Form1.Top > z.y * 200 / 13 Then
fy = -1
End If
If fx = 1 Then
Form1.Left = Form1.Left + 50
End If
If fy = 1 Then
Form1.Top = Form1.Top + 50
End If
If fx = -1 Then
Form1.Left = Form1.Left - 50
End If
If fy = -1 Then
Form1.Top = Form1.Top - 50
End If
If z.x * 200 / 13 > Form1.Left And z.x * 200 / 13 < Form1.Left + 480 Then
If z.y * 200 / 13 > Form1.Top And z.y * 200 / 13 < Form1.Top + 495 Then
Timer1.Enabled = False
SetFormTopmost Form1
v = MsgBox("你一百分是我的了", vbOKOnly, "结帐吧")
If v = vbOK Then
End
End If
End If
End If
End Sub