Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Storing & Retrieving Icons in a Resource File


Message #1 by "Greg Pearson" <jagged30net@n...> on Tue, 13 Aug 2002 14:50:13
Pete, I was afraid this was going to require some work. :) Ok here is some code:

Set imgTemp = imgNewList.ListImages.Add(1, , LoadResPicture(108, 1)) ' Open
tolLott.ImageList = imgNewList
Set btnOpen = tolLott.Buttons.Add(, , "Open", , 1)

1. imgTemp is my ListImage control.
2. imgNewList is my ImageList control.
3. "108" is the index for one of my icons.

I'm not sure what I was doing wrong before, but this code actually works. Now the problem I have is my icon is too big and the
caption/description is not showing. I tried setting the height and width properties of "btnOpen", after it was added to the toolbar,
but got the error "property is read- only."

I believe the open icon is the standard one that comes with VB and other MS products. Not sure what the default size is 16x16?

"Peter N. Kipe" <pkipe@c...> wrote:

>I use icons in resource files quite a bit, and have no real problems.  Can
>you be more descriptive of yours?
>
>Pete
>
>-----Original Message-----
>From: Greg Pearson [mailto:jagged30net@n...]
>Sent: Tuesday, August 13, 2002 2:50 PM
>To: professional vb
>Subject: [pro_vb] Storing & Retrieving Icons in a Resource File
>
>
>I'd like to find a way to store and retrieve my application icons in a
>resource file. My application has a toolbar that is fed by a ImageList
>control. After storing my icons in the resource file, I can not load them
>into the image list control using the resource file methods/properties. I
>apologize for being vague; I do not have the code right now, so I'm going
>by memory.
>
>Hopefully, this will lead me to a better implementation of the toolbar
>altogether - maybe the Coolbar? The current toolbar is not very polished.
>
>Thanks, gAp
>
>---
>Visual C# - A Guide for VB6 Developers
>This book will make it easy to transfer your skills
>from Visual Basic 6 to C#, the language of choice
>of the .NET Framework.
>http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
>
>
>
>
>---
>Visual C# - A Guide for VB6 Developers
>This book will make it easy to transfer your skills 
>from Visual Basic 6 to C#, the language of choice 
>of the .NET Framework.
>http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
>
>


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@N...!
http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


  Return to Index