以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  这个计时器里怎么写  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=145395)

--  作者:hongye
--  发布时间:2020/1/18 13:21:00
--  这个计时器里怎么写

MouseEnter事件


Static cnt As Integer
cnt = cnt+1
If cnt = 100 Then
    cnt = 0
    e.Form.Controls("PictureBox1").Left = 0
Else
    \'If e.Form.Controls("PictureBox1").Left < -100
        e.Form.Controls("PictureBox1").Left=e.Form.Controls("PictureBox1").Left-1
    \'End If
End  If
[此贴子已经被作者于2020/1/18 13:31:36编辑过]

--  作者:有点蓝
--  发布时间:2020/1/18 14:42:00
--  
具体要做什么功能?MouseEnter事件和计时器有啥关系

Dim p As WinForm.PictureBox = e.Form.Controls("PictureBox1")
p.Left=p.Left-1
If p.Left < -100
    p.Left=0
End If

--  作者:hongye
--  发布时间:2020/1/18 14:55:00
--  
我需要鼠标移到PictureBox1控件时,PictureBox1移动到框外停止,并停留在框外
[此贴子已经被作者于2020/1/18 14:56:14编辑过]

--  作者:有点蓝
--  发布时间:2020/1/18 15:27:00
--  
截图上传实例说明一下效果
--  作者:hongye
--  发布时间:2020/1/18 17:01:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:移动按键.foxdb


--  作者:有点蓝
--  发布时间:2020/1/18 17:10:00
--  
移到窗口之外有什么作用?如果要隐藏,直接设置visible属性即可

MouseEnter事件
e.Sender.Visible = False

MouseLeave
e.Sender.Visible = true

--  作者:hongye
--  发布时间:2020/1/18 20:23:00
--  
图片点击可在新窗口打开查看想让它有种动画效果
--  作者:有点蓝
--  发布时间:2020/1/19 9:37:00
--  
MouseEnter事件
vars("in") = True
e.Form.TimerEnabled = True

MouseLeave
vars("in") = false
e.Form.TimerEnabled = True

timertick事件
Dim p As WinForm.PictureBox = e.Form.Controls("PictureBox1")
If vars("in") = True Then
    p.Left=p.Left-1
    If p.Left < -65
        e.Form.TimerEnabled = False
    End If
ElseIf vars("in") = False 
    p.Left=p.Left+1
    If p.Left > 0
        e.Form.TimerEnabled = False
    End If
End If