vb imagelist控件怎么用代码加载图片?
展开全部
添加一个CommandButton控件一个Image控件一个ImageList控件
Private Sub Form_Load()
Image1.Stretch = True
ImageList1.ListImages.Add , , LoadPicture("C:\WINDOWS\Web\Wallpaper\bliss.bmp")
ImageList1.ListImages.Add , , LoadPicture("C:\WINDOWS\Web\Wallpaper\img00.jpg")
End Sub
Private Sub Command1_Click()
Static flag As Boolean
flag = Not flag
Dim i As Integer
If flag Then
i = 1
Else
i = 2
End If
Image1.Picture = ImageList1.ListImages(i).Picture
End Sub
Private Sub Form_Load()
Image1.Stretch = True
ImageList1.ListImages.Add , , LoadPicture("C:\WINDOWS\Web\Wallpaper\bliss.bmp")
ImageList1.ListImages.Add , , LoadPicture("C:\WINDOWS\Web\Wallpaper\img00.jpg")
End Sub
Private Sub Command1_Click()
Static flag As Boolean
flag = Not flag
Dim i As Integer
If flag Then
i = 1
Else
i = 2
End If
Image1.Picture = ImageList1.ListImages(i).Picture
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询