[dba-Tech] built-in icons

John Bartow john at winhaven.net
Thu Oct 18 10:21:33 CDT 2007


Susan,
Just to be clear on this issue, here is what I think you are asking: you
create a command button and then use an image file in .bmp or .ico format
from the file system, let's say "C:\MyImage.bmp". You click browse to select
"C:\MyImage.bmp" as the image for the command button. The image is cached
(it is stored) in the command button's PictureData property. The command
button's Picture property stores the original path to "C:\MyImage.bmp".
However, whether you delete or change "C:\MyImage.bmp" is now irrelevant to
the operation of the command button unless you reference the Picture
property.

If you want to use the same image that an icon has you would reference it as
"cmdButton.PictureData".

If you want to use the same image that an icon originally referred to you
would reference it as "cmdButton.Picture".

By doing the former you can refer to one cached image for any number of
command buttons, say on the form's OnOpen event or something such as that.
However the command buttons would all retain their original images if viewed
in design mode.

By doing the latter you can store an image file with an application and
change the image at runtime without editing anything in the application. But
alas, it has it dangerous side too, anyone can change the image on file and
name it the same thing as the original and that is what will show in your
icons if you reference "cmdButton.Picture"

Note: you can reference the PictureData property if you've used Access's
built-in bitmaps but if you reference the Picture property it will return an
error as it does not store the access image reference #.

HTH
John B.





More information about the dba-Tech mailing list