|
-
Nov 2nd, 2000, 12:26 AM
#1
Thread Starter
Addicted Member
I have a transpearent form that has a picture image.
I had a timer that will change the form's image at appropriate times.
If I make an exe of the code, only the form's picture I set at design time is included, the other two images are not.
This is the code I used to set the form's picture to other pictures:
Me.Picture = LoadPicture("C:\WINDOWS\SYSTEM\NTLocked.jpg")
'as you can see, I am using a path to the images, I know there must be a better way.
How can I keep all three image files inside the EXE ?
I appreciate any time and efforts,
Daniel Christie
-
Nov 2nd, 2000, 04:25 AM
#2
Addicted Member
Put three invisible image controls (preferably as an array) on your form with the desired images in them.
In your timer event put something like this
private sub Timer1_Timer
static intIndex as integer
'This makes the app cycle through the images
intIndex = Mod(intIndex + 1, 3)
Me.picture = imgImage(intIndex).Picture
Me.Refresh
end sub
(This is untested code, I typed it straight in here)
That should do it I guess.
Regards,
Laurens
Using VB5 Enterprise edition SP3
VB6 Enterprise edition SP5
-
Nov 2nd, 2000, 04:37 AM
#3
Frenzied Member
Use the resource manager in VB. Add the pics to a resource file and use GetPicture etc to load them up.
(see MSDN for exact details)
-
Nov 2nd, 2000, 04:46 AM
#4
Addicted Member
Yes, MLewis's suggestion is better, but I wasn't sure if Daniel_Christie had the Professional Edition or better. I was told that only those versions had a resource manager.
Regards,
Laurens
Using VB5 Enterprise edition SP3
VB6 Enterprise edition SP5
-
Nov 2nd, 2000, 04:52 AM
#5
Frenzied Member
Nah, go to Microsoft's web site and you can download the resource manager, class builder, all kinds of stuff for learning edition/academic edition/etc and it works fine.
-
Nov 2nd, 2000, 09:28 AM
#6
Thread Starter
Addicted Member
Thanks guys, I appreciate your posts...
I am running VB5 Enterprise Edition.
Daniel Christie
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
|