按钮的两个图片切换效果

前端之家收集整理的这篇文章主要介绍了按钮的两个图片切换效果前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

下面是一个通过单击按钮来切换两个图片显示的样例程序。

Dim a As IPictureDisp

Dim b As IPictureDisp Private Sub CommandButton1_Click() CommandButton1.Picture = IIf(CommandButton1.Picture Is a,b,a) End Sub Private Sub UserForm_Initialize() Set a = LoadPicture("Object Type hide.JPG") Set b = LoadPicture("Object Type show.JPG") CommandButton1.Picture = a End Sub

猜你在找的VB相关文章