Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Comment to button

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
hi all.
how can i add comment to any button and it display on mouse move event ?
 
the right Answer
Untitled_wo5xev.png
 
Ameedoo3000
Make sure in your MAIN form, or at the form level you are using that the environment variable "ShowTips" is = .T.
You can check in your code by setting this message:

MESSAGEBOX(SET("SHOWTIPS"))

And when it reaches that point (put that code in the button MouseEnter event) it will tell you if ShowTips is on or not.

Also, for that button, place in it's init clase:

This.ToolTipText = <whatever you want it to say>

The contents above in <...> can be a literal string, a variable or field.

Examples of the 3 above in order:

This.ToolTipText = "This is the text that shows when my mouse enters the object."

lcTipText = "This is the text that shows when my mouse enters the object."

This.ToolTipText = lcTipText

From a table named TIPS with a field TIPTEXT and content as above:

This.TooTipText = TIPS.TIPTEXT

(Note that you need to be navigated to that record first, but that's how you'd express it.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Ahmed, the key point here is the comment in the screen shot that you posted: "Sometimes reading the Help file can save a lot of time".

Once we pointed you to the ToolTiptext property, you would have got the full answer by looking up that property in the Help. That would have in turn pointed you to the ShowTips property, and you would have had all the information you needed.

I'm not trying to discourage you from asking questions here, but the Help file is there for a reason. Using the Help file as a primary resource will not only save you time, it will also help you learn your way round VFP.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yeah.
Thank you very much dear Mike and dear dear Scott for their wonderful briefing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top