|
-
Jun 5th, 2000, 05:50 AM
#1
Thread Starter
New Member
I have an app with multiple forms. I know how to add icons using code in the form, as well as using the property page. Trying to think more object oriented, I want to put an icon reference in a module (or public variable) and 'grab' the icon for all the forms in this manner. I've been dinking around a bit and can't get it to work right. Any help out there?
This is what I've been trying:
Public myIcon As Picture
myIcon = LoadPicture("c:\myapp\litening.ico")
or
Public Function myIcon() As Image
myIcon = LoadPicture("c:\myapp\litening.ico")
End Function
When I try to call these values I get all kinds of different errors! thanks!
-
Jun 5th, 2000, 06:44 AM
#2
Why not store your Icon(s) in a Resource file then you can load them using the following syntax, (the Resource file gets compiled into the EXE):
Code:
Private Sub Form_Load()
Icon = LoadResPicture("CD_ICON", vbResIcon)
End Sub
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
|