Solved

Updating Icons

Posted on 2000-02-27
4
175 Views
Last Modified: 2010-05-02
We are developing an application that uses icons that are also being developed/modified at the same time.  Is it possible to somehow include these icons at compile time rather than design time so that we don't have to visit each form that uses a particular icon and update it manually every time an icon changes?
0
Comment
Question by:DJWalker
  • 2
4 Comments
 
LVL 5

Expert Comment

by:KDivad
ID: 2562316
So that if you alter the icon, then it's automatically updated in the form instead of VB using it's .frx files?
Not that I know of, unless you rewrite the .frx file(s)...
0
 
LVL 3

Accepted Solution

by:
paulstamp earned 100 total points
ID: 2562321
Use the VB Resource File editor add-in and place your icons in a resource file. Give each one a unique identifier and then use something along these lines to extract them at run time :

Set Picture1.Picture = LoadResPicture(101, vbResIcon)

where 101 is the ID of the icon you want and vbResIcon in just a constant specifying its an icon not a bitmap.

This way you can just update the RES file and all your forms will be updated automatically.

Look in the help file under LoadResPicture for more details.
0
 
LVL 4

Expert Comment

by:Jeremy_D
ID: 2564413
You can also use VB's LoadPicture function to load the icon at run-time from a network drive. This way you can even change the icon between compiles. Just overwrite the icon-file with the new one, and as soon as the program is restarted the changes will show.
0
 
LVL 3

Expert Comment

by:paulstamp
ID: 2564461
You could load the icons at run time but from ico files but it does mean that people could overwrite or delete (accidentally or deliberately) the icon files and cause probs with the program.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 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