Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quick icon question

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
I was under the impression that to create an icon file that's suitable for VB, I could create a windows bitmap file and then change the extension from &quot;.bmp&quot; to &quot;.ico&quot;. I tried this, and it didn't work. I searched my hard-drive for *.ico, and tried one of these (icons I had not created). It worked just fine, but upon trying to rename that to &quot;.bmp&quot; and open that file, I couldn't do it.. leading me to believe that the &quot;ico&quot; files needed to create icons for VB are different than standard bitmap files. How do I create a suitable icon for use with a VB form? [sig]<p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."[/sig]
 
You are correct in the assumption that .ico files are different from .bmp files. However, these files can be used interchangeably in VB.

Go to the Projects menu in VB and select Components, then select Microsoft Windows Common Controls. If you have VB6, there will be 3 of these: Microsoft Windows Common Controls 6.0, &quot;&quot; - 2 6.0 and &quot;&quot; - 3 6.0. Select the first one.

This will put an ImageBox control on your toolbox. You can put one of these control on a form, and then bring up the property page for this control (double click the Custom property in the Properties pane).

On the Images tab of the property page, you can add most types of images, including bitmaps, icons, cursors, and metafiles.

I'm not sure how you want to use the icon, but there are several ways to access the images that are stored in the ImageBox control.

Hope this helps.

Steve [sig][/sig]
 

I don't think that this works for the Form.Icon property -- or does it?
[sig]<p> Tarek<br><a href= > </a><br>The more I learn, the more I need to learn![/sig]
 
You are correct - to use the Form.Icon property you need a legitimate icon file. I use a shareware edit to create icons or transform bitmaps into icon.

Here a URL to the reviews - also has the download link - it's only $20US - and it works great - I've used it since version3.0 now it's at version6.0


And no it's not mine - I get no royalties for my endorsement - just a great program.

[sig]<p>Bruce Voelp<br><a href=mailto:bvoelp@if.rmci.net>bvoelp@if.rmci.net</a><br><a href= > </a><br>Earn AS in 1976 and BS in 1986. Learn to talk with computers when the only interface was 80 column punch cards, and paper tape.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top