|
-
August 18th, 2002, 10:06 AM
#1
Can't get Bitmap to show up...
Hi all,
On my form I have a picture box called "Picture1" and a button called "Command1", here is the code that is in the button:
If Picture1.Picture = LoadPicture(App.Path & "\Folder1\" & "PicA" & ".BMP") Then
Picture1.Picture = LoadPicture(App.Path & "\Folder1\" & "PicB" & ".BMP")
End If
I have checked the folder to ensure that these two pictures exist, but when I click the button, the picture does not change.
Any Info on how I can get this to work??
Thanks
Mark
-
August 18th, 2002, 11:04 AM
#2
if you use LoadPicture(..) funtion then you get an handle to the pitcure. 2 calls to the LoadPicture() with same picture parameter can return different handle. I suggest you that you can use a flag variable to set and check the current picture showed.
If (NowPic = "PicA" & ".BMP") Then
Picture1.Picture = LoadPicture(App.Path & "\Folder1\" & "PicB" & ".BMP")
NowPic="PicB" & ".BMP"
End If
and initialize the NowPic variable with the picture that is in the Picture1 (.. maybe "PicA" & ".BMP") at the start of program.
I hope i can help you...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|