Help and Support

Article ID: 190088 - Last Review: May 13, 2003 - Revision: 3.1

BUG: Icon Resource May Not Appear as Expected

This article was previously published under Q190088

On This Page

Expand all | Collapse all

SYMPTOMS

LoadResPicture functions differently when a Visual Basic project runs in the IDE or as a compiled EXE. Loading a 16x16 Icon resource within the IDE will return the proper icon, while in a compiled EXE it will result in an icon that is "fuzzy."

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION


Steps to Reproduce Behavior

NOTE: This example assumes that the Resource Editor has already been installed and added to the Tools menu.
  1. Create a new Standard EXE project in Visual Basic. Form1 is created by default.
  2. Add an Image control (Image1) to Form1.
  3. Paste the following code into Form1's code window:
          Private Sub Form_Load()
             Set Image1.Picture = LoadResPicture(101, vbResIcon)
          End Sub
    
    						
  4. Select Resource Editor from the Tools menu.
  5. Select Add Icon from the Resource Editor's toolbar.
  6. In the "Open An Icon File" DialogBox, select a 16x16 icon to add to the resource file. The icon just added will have resource ID 101.
  7. Save the resource file as "Test.RES" and close the Resource Editor.
  8. Select Make Project1.exe from the File menu to compile the project.
  9. Press the F5 key to run the project within the IDE. Form1 will appear with the proper looking icon.
  10. Run the compiled Project1.exe. Form1 will appear with the icon looking different than the original.

APPLIES TO
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
Keywords: 
kbbug KB190088

Article Translations