[dba-VB] Icons on Buttons & form templates in VB 6

Bryan Carbonnell Bryan_Carbonnell at cbc.ca
Wed Mar 5 07:45:04 CST 2003


I have been recently bitten by something like this.

What VB does is store copies (well actually most of the binary data for a form) in the .frx file in the same directory as the .frm

Once compiled into a DLL or exe, the icons are inside of the compiled file.

So if you are creating a new form from a template, I would suspect that the template either doesn't have a corresponding frx, or it doesn't get copied over correctly to your project directory.

Not really an answers or advice, but information that was new to me about a month ago so it may not be entirely accurate., but the jist should be right.

Bryan Carbonnell
bryan_carbonnell at cbc.ca

>>> subs at solution-providers.ie 05-Mar-03 8:17:39 AM >>>
Hello All,

I am curious as to what is considered best practice when using icons or
pictures on buttons etc

When an icon is created onto a button, it appears that the application
retains a link to the icon, or to put it another way, it is passed by ref as
opposed to by val.  If this is the case, I will probably get an error when I
roll out on a pc without the same paths as I have (which are the normal MS
Office setups).

So I wondered what others do.  Do you move the.ico files to the app.path
directory and then ship then with the exe?

The reason I noticed the problem is when I created a form from a template.
The template lost it's icons.  I also got some other errors relating to
class modules that were also referenced from the form, but I am not so
worried about those as I know where they are.

I am not so much asking one question here as wondering what you guys do with
your .ico files and also what your experience has been with template forms.

Thanks in advance for your time,




More information about the dba-VB mailing list