怎样用visual basic制作单击按钮就可转换不同图片的小程序
发布网友
发布时间:2022-12-26 23:57
我来回答
共2个回答
热心网友
时间:2023-10-17 19:10
'事先找的2张图片的路径
'C:\Program Files\Tencent\QQ\244326867\CustomFace\F4F0C0B353BCE7228DAFD104BDCDBE87.jpg
'C:\Program Files\Tencent\QQ\244326867\CustomFace\F4F0C0B353BCE7228DAFD104BDCDBE87fixed.bmp
Dim a As Integer
Private Sub Command1_Click()
tp1 = "C:\Program Files\Tencent\QQ\244326867\CustomFace\F4F0C0B353BCE7228DAFD104BDCDBE87.jpg"
tp2 = "C:\Program Files\Tencent\QQ\244326867\CustomFace\F4F0C0B353BCE7228DAFD104BDCDBE87fixed.bmp"
If a = 1 Then
a = 2
Picture1.Picture = LoadPicture(tp1)
Else
a = 1
Picture1.Picture = LoadPicture(tp2)
End If
End Sub
Private Sub Form_Load()
a = 1
End Sub
热心网友
时间:2023-10-17 19:10
Dim a As Boolean
Private Sub Command1_Click()
If a = False Then
Picture1.Picture = LoadPicture("E:\xxx\xxxx.bmp")
a = True
Else
Picture1.Picture = LoadPicture("E:\xxx\xxxxx.jpg")
a = False
End If
End Sub