How can I make text appear when I hover over an image (1 Viewer)

Pinkoto

Registered User.
Local time
Today, 01:20
Joined
Jun 25, 2014
Messages
73
Hello,
how can i make text appear when i hover over a picture? Can i make it appear under the picture? And can i make different text to appear in the different records of the form although it will be the same picture?

Thank you again in advance : )
 

GinaWhipp

AWF VIP
Local time
Today, 04:20
Joined
Jun 21, 2011
Messages
5,899
Not the way you think. There is no Caption property for an Image Control so you would have to do a work around. You might be able to use a Label but even then there would be some coding to get the Caption to change for each record. And, because you want it change with each record, there would have to be either a field that is storing the text or it would have to be some algorithm of the other Controls on the Form.

EDIT: And I see CJ_London ws kind enough to post the steps using a TEXT Box! :D
 

CJ_London

Super Moderator
Staff member
Local time
Today, 09:20
Joined
Feb 19, 2013
Messages
16,607
I presume the controltip text is not what you want?

To do what you want:

1. Create a textbox control for your form, we'll call it ImageText and place it on your form where you want it to appear
2. In your form recorsource you will need a field to contain the text for each image - set the controlsource for the ImageText control to this field. (or some other way of populating the text)
3. Set the visible property for the ImageText control to false
4. In the ImageText control mousemove event put the following code:

Code:
ImageText.Visible=True
5. In the Detail section (assuming this is where your image control is) mousemove event put the following code

Code:
ImageText.Visible=False

Now when you open the form the textbox will appear when the cursor is over the image and disappear when it moves off the control.

Note: move the mouse too fast and the text may not appear. And allow sufficient space around the image control so the detail mousemove event can trigger.
 

Pinkoto

Registered User.
Local time
Today, 01:20
Joined
Jun 25, 2014
Messages
73
thank you! I put
ImageText.Visible=True

in the image properties
and i put the other code in a frame of the first picture. because i wanted the text box to disappear when my mouse isn't on the picture.And it worked!

I have another question. if i have 10 check boxes which show a picture if they are checked. How can i make the last pictures be in the position of the first picture if the first picture isn't there (because the check box isn't checked for her) I want this because if the first 9 check boxes arent checked the last picture will be shown too much in the right. It will look good if i have the other pictures there but im not gonna have all the check boxes checked in every record
 

Users who are viewing this thread

Top Bottom