PDA

View Full Version : Solved: Programatically Set Picture control Picture propert to "(None)"



gmaxey
07-15-2012, 07:28 PM
I've been polishing the cannon ball on a Word template Add-In that I am developing and one nagging issue is that I can't find a way to programatically remove a bitmap that is displayed on a userform picture contol.

I have a listbox that lists all the image files in a folder. When the user clicks on a listed file the picture controls displays a preview. I recently added a feature that allows the user to "delete" the image file in its source folder. When this feature is executed the file is deleted and the list is refreshed but the image displayed in the picture control remains.

The only thing I've been able to come up with is to set the control visible property to false when the form is displayed. Then when and image is selected in the list I toggle the visible property back to true and display the image. If the user deletes the image the i set the property back to false.

I would like to leave the control displayed but remove (or set to "None') the picture property.

Any ideas? Thanks.

gmaxey
07-15-2012, 07:41 PM
Doh!!

Me.imgPreview.Picture = LoadPicture("")