VB图片按钮变换
在用最原始的方法,用图片做程序风格..在用图片做按钮时,不知道鼠标滑过图片变换和按下变换图片的代码.期望有达人知道告知..谢谢...最好写详细点,带注释..我还是个菜鸟....
在用最原始的方法,用图片做程序风格..
在用图片做按钮时,不知道鼠标滑过图片变换和按下变换图片的代码.
期望有达人知道告知..谢谢...
最好写详细点,带注释..我还是个菜鸟.. 展开
在用图片做按钮时,不知道鼠标滑过图片变换和按下变换图片的代码.
期望有达人知道告知..谢谢...
最好写详细点,带注释..我还是个菜鸟.. 展开
2个回答
展开全部
准备三张图散简禅分别为 平常状态,鼠标滑过,鼠标按下 时咐亏用
例冲尘如1.jpg,2.jpg,3.jpg
用image做
在image1的mousemove事件中读入2.jpg
在image1的mousedown事件中读入3.jpg
在form的mousemove事件中读入1.jpg
这只是思路的示例,你可以完善代码,甚至利用API实现MOUSEIN 和 MOUSEEXIT 事件
Private Sub image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture=LoadPicture("3.jpg")
end sub
Private Sub imgExit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim sPicFile As String
image1.picture=loadpicture("2.jpg")
End If
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture=loadpicture("1.jpg")
End Sub
例冲尘如1.jpg,2.jpg,3.jpg
用image做
在image1的mousemove事件中读入2.jpg
在image1的mousedown事件中读入3.jpg
在form的mousemove事件中读入1.jpg
这只是思路的示例,你可以完善代码,甚至利用API实现MOUSEIN 和 MOUSEEXIT 事件
Private Sub image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture=LoadPicture("3.jpg")
end sub
Private Sub imgExit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim sPicFile As String
image1.picture=loadpicture("2.jpg")
End If
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture=loadpicture("1.jpg")
End Sub
展开全部
'先画个按钮,名字叫Command1
'下面这几行是按钮按下
Private Sub Command1_Click()
Command1.Picture = LoadPicture("鼠标按下变蚂旅袜换那张图片的路径")
End Sub
'下面几行是鼠标滑过
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Picture = LoadPicture("鼠标镇缓滑过图片闷激变换那张图片的路径")
End Sub
'下面几行是原来的图片和鼠标离开按钮时的图片
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Picture = LoadPicture("原来按钮图片路径")
End Sub
'下面这几行是按钮按下
Private Sub Command1_Click()
Command1.Picture = LoadPicture("鼠标按下变蚂旅袜换那张图片的路径")
End Sub
'下面几行是鼠标滑过
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Picture = LoadPicture("鼠标镇缓滑过图片闷激变换那张图片的路径")
End Sub
'下面几行是原来的图片和鼠标离开按钮时的图片
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Picture = LoadPicture("原来按钮图片路径")
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询