Dim Picture1 As PictureBox ? Problem with LoadPicture !
My VB6 Code :
Dim Picture1 As PictureBox
Picture1.Picture = LoadPicture("D开发者_运维技巧:\1538125064shot.jpg")
I am getting the following error on the second line:
91 : Object variable or With block variable not set
Your variable is declared as Picture1
, but you try to access it as Picture1v
.
Use StdPicture
to hold pictures before using them
Dim myPic As StdPicture
Set myPic = LoadPicture("D:\1538125064shot.jpg")
Later you can apply it to a picture box like this
Set Picture1.Picture = myPic
精彩评论