Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Icon Resources in VB.NET 2003
Message
From
18/05/2005 19:55:02
 
 
To
18/05/2005 13:21:45
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01015453
Message ID:
01015641
Views:
17
Joe,

>>This will be a real .NET 101 question but I am struggling to locate an easy to understand solution.<

No, it's not really a beginner's question (if that makes you feel any better <g>). Look at adding an ImageList to your Form. You will then be able to choose images from the list for buttons and other things. The way it works is that the images are stored in a resource (see the code that gets generated when you do this and you may also want to look at the ResourceManager in the Help). When you choose an image for a button for example, it uses an image based on that image's index in the list. You can easily change the image in one place by changing only the one in the ImageList. The new image will show up wherever the old image was used.

I'm not 100% sure though if you can use an image from this list for the Form's icon, but it should work fine with everything else.

~~Bonnie



>This will be a real .NET 101 question but I am struggling to locate an easy to understand solution.
>I have icon files that are used by buttons, menus and forms in my Windows Forms application.
>
>How can I store these so that I may simply reference them in my project and the project will know where to find them at run/compile time?
>
>Right now when I use an icon I click the property to assign the icon (e.g. Winform.Icon) and use the Open file dialog that is displayed to "hardcode" an icon to the property. This works but really is a pain if I want to change this icon in 20 or so different places (First I must remember every property that I changed to point to a particular icon and then I must alter that property to point to a new icon).
>
>Any suggestions?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform