VB代码设计
代码设计:点击各图片时,使得image6.picture属性分别等于相应图片即可。image1~5点击时在image6显示其大图只需要代码就OK...
代码设计:
点击各图片时,使得image6.picture属性分别等于相应图片即可。
image1~5 点击时 在image6显示其大图
只需要代码就OK 展开
点击各图片时,使得image6.picture属性分别等于相应图片即可。
image1~5 点击时 在image6显示其大图
只需要代码就OK 展开
2个回答
展开全部
Private Sub Image1_Click()
Image6.Stretch = False
Image6.Picture = Image1.Picture 'Image1_Click
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5 '宽度放大1.5倍数自己修正范围
Image6.Height = Image6.Height * 1.5 '高度放大1.5倍数自己修正范围
End Sub
Private Sub Image2_Click()
Image6.Stretch = False
Image6.Picture = Image2.Picture 'Image2_Click
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5
Image6.Height = Image6.Height * 1.5
End Sub
Private Sub Image3_Click()
Private Sub Image4_Click()
Private Sub Image5_Click()
依样画葫芦
如果你的image1到image5改为image1的控件数组,index 从 0 到 4
那么代码更简洁,如下:
Private Sub Image1_Click(Index As Integer)
Image6.Stretch = False
Image6.Picture = Image1(Index).Picture
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5
Image6.Height = Image6.Height * 1.5
End Sub
Image6.Stretch = False
Image6.Picture = Image1.Picture 'Image1_Click
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5 '宽度放大1.5倍数自己修正范围
Image6.Height = Image6.Height * 1.5 '高度放大1.5倍数自己修正范围
End Sub
Private Sub Image2_Click()
Image6.Stretch = False
Image6.Picture = Image2.Picture 'Image2_Click
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5
Image6.Height = Image6.Height * 1.5
End Sub
Private Sub Image3_Click()
Private Sub Image4_Click()
Private Sub Image5_Click()
依样画葫芦
如果你的image1到image5改为image1的控件数组,index 从 0 到 4
那么代码更简洁,如下:
Private Sub Image1_Click(Index As Integer)
Image6.Stretch = False
Image6.Picture = Image1(Index).Picture
Image6.Stretch = True
Image6.Width = Image6.Width * 1.5
Image6.Height = Image6.Height * 1.5
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询