自己画 定一个窗体级变量,以便判断鼠标是否是第一次移出 dim FirstOut as boolean在Form_MouseMove事件处理函数里画,如if x>0 and x<100 and y>0 and y<60 then me.line (0,0)-(100,0),vbwhite'画顶部的白色线条 me.line (0,0)-(0,60),vbwhite'画左边的白色线条 me.line (100,0)-(100,60),vbblack'右边黑色线条 me.line (0,60)-(100,60),vbblack'底部 firstout=false else me.line (0,0)-(100,0),me.backcolor me.line (0,0)-(0,60),me.backcolor me.line (100,0)-(100,60),me.backcolor me.line (0,60)-(100,60),me.backcolor if firstout=false then firstout=true msgbox "移出了。" end if end if如果要定义事件也可以 event MouseOut() 把msgbox那句话改成raiseevent mouseout 但是窗体自身不能接收自身throw出的事件,只有其容器或以上级别的窗体才能接收该事件
定一个窗体级变量,以便判断鼠标是否是第一次移出
dim FirstOut as boolean在Form_MouseMove事件处理函数里画,如if x>0 and x<100 and y>0 and y<60 then
me.line (0,0)-(100,0),vbwhite'画顶部的白色线条
me.line (0,0)-(0,60),vbwhite'画左边的白色线条
me.line (100,0)-(100,60),vbblack'右边黑色线条
me.line (0,60)-(100,60),vbblack'底部
firstout=false
else
me.line (0,0)-(100,0),me.backcolor
me.line (0,0)-(0,60),me.backcolor
me.line (100,0)-(100,60),me.backcolor
me.line (0,60)-(100,60),me.backcolor
if firstout=false then
firstout=true
msgbox "移出了。"
end if
end if如果要定义事件也可以
event MouseOut()
把msgbox那句话改成raiseevent mouseout
但是窗体自身不能接收自身throw出的事件,只有其容器或以上级别的窗体才能接收该事件