[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB6 Form Icons display as negatives

Posted on 2008-11-13
2
Medium Priority
?
362 Views
Last Modified: 2012-05-05
In my VB6 app I have one form that can be used for several things, and depending on what it's used for it changes its icon.
In the development environment this works fine, but when in a compiled and installed app the icons come out as negative versions of what they should, like a film negative with all the colours reversed (see attached picture)
I have tried:
Loading the icon from another form
Me.Icon = frmIcons.imgDefIcon(0).Picture
Loading the icon directly from the source file.
Me.Icon = LoadPicture("C:\Projects\Icons\16\user_16x16.ico")
Both cause the same problem. This only happens on the forms that change their icon, not on ones that keep the one specified at design time.
I load icons from other forms all the time, and this works fine in the IDE or on a compiled program, but it doesn't seem to work when it's settign the form icon, as opposed to an icon displayed somewhere else on the form.
Any thoughts?
Icon-Problem.bmp
0
Comment
Question by:Charlie_Barnard
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
c0ldfyr3 earned 500 total points
ID: 22956377
Try adding the icons to an image list, i would imagine it's something to do with the fact that you're loading a 'picture' using both methods above and VB is doing a crappy job of converting it to an icon. If you add them to an imagelist and retrieve them from there it should save them as an icon and give your caller an icon instead of a bitmap which should fix your problem =) It's also a cleaner practice ;)
0
 
LVL 10

Expert Comment

by:c0ldfyr3
ID: 22956386
Sorry just incase, the imagelist is a control contained in the 'Microsoft Common Controls 6' component. You can add and remove images by right clicking it and going to properties ;)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question