开发者

Dim Picture1 As PictureBox ? Problem with LoadPicture !

开发者 https://www.devze.com 2023-02-02 04:24 出处:网络
My VB6 Code : Dim Picture1 As PictureBox Picture1.Picture = LoadPicture(\"D开发者_运维技巧:\\1538125064shot.jpg\")

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
0

精彩评论

暂无评论...
验证码 换一张
取 消