Results 1 to 2 of 2

Thread: icons

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Location
    Chandler AZ
    Posts
    5
    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!

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    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
  •  



Click Here to Expand Forum to Full Width