Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2004

Tip: Looking for answers? Try searching our database.

text in a picture box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phil - 31 May 2004 06:17 GMT
I'm using the code below to display images in a image box but when an image
is not available I would like the text "no image available" to be displayed
where the image should be in the image box
can this be done  and if so how do I alter the code to achieve this
thanks phil

 If Len(Dir("c:\schedule\images\cladding\" & cbcla_external & ".bmp")) > 0
Then
   ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
cbcla_external & ".bmp")
Doug Robbins - Word MVP - 31 May 2004 07:07 GMT
Hi Phil,

Might be better to create an image that contains that information and load
it if no image is available.

You can create such an image by using Copy then Edit>Paste Special>Picture.

Alternatively, overlay the image control with a label containing that
information and have it's visible property changed from False to True when
you want it to be displayed.

Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP

> I'm using the code below to display images in a image box but when an image
> is not available I would like the text "no image available" to be displayed
[quoted text clipped - 6 lines]
>     ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
> cbcla_external & ".bmp")
Jonathan West - 31 May 2004 18:49 GMT
Hi Phil,

you could have a label of exactly the same shape & size as the image
control, positioned behind the image and with the appropriate text included.

Then, when no image is available, set the Visible property of the Image
control to False, and the label behind will be revealed!

Signature

Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

> I'm using the code below to display images in a image box but when an image
> is not available I would like the text "no image available" to be displayed
[quoted text clipped - 6 lines]
>     ImageCladding.Picture = LoadPicture("c:\schedule\images\cladding\" &
> cbcla_external & ".bmp")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.