PDA

View Full Version : Help in pictures on user form



dansam
03-01-2007, 08:26 AM
Hi,:hi:
I have two problems:

(1) Is it possible to insert a *.png image in a user form like we insert *.jpg, *.gif. . ????
(2) I have a picture on the sheet1 of the workbook. Now I want to insert the same picture on the user form (not from the source file but from the sheet !). I mean how to set the address property of a picture (on user form) that it shows the picture which is on sheet1??? :think:

Regards,
Dan

lucas
03-01-2007, 08:38 AM
Hi Dan,
I can't get excel to recognize a .png file to insert on a userform....I just tried. Not saying it can't be done but I think it's a problem....just convert it with any graphics program.

Second, why would you wish to link it to the sheet. Why not just embed it in the userform and be done with it. Is it going to change regularly or something?

Something like this will link an employees picture with a listbox value....the picture must be named the same as the listbox value minus the extention...jpg, etc.
Employee_Img.Picture = LoadPicture(fPath & "\" & ListBox1.Value & ".jpg")

dansam
03-01-2007, 09:09 AM
Hi Lucas,

just convert it with any graphics program.

Thanks for suggestion but converting it to the other format rather than png, it loses its pure quality (some lose of graphics which not happens in png) therefore I was thinking on that matter!


Second, why would you wish to link it to the sheet. Why not just embed it in the userform and be done with it. Is it going to change regularly or something?


The matter is what I have a program that changes the icon of a title bar of a user form.
So for that I always have to select the icon source file manually or I have to keep it along with my main file because it is linked with it, (In this situation (may be) any one can change it) so I was thinking that if I can load the icon file directly form my sheet as I already inserted it in the sheet, then it will be a good solution and secondly I want to know if it is possible or not to use it for some other personal usage also.
regards,
Dan