INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Tips -N- Tricks

How can I add context sensitive help to a data entry form? by ChrisRChamberlain
Posted: 22 Jul 00

If calling a conventional help file is too cumbersome and/or ToolTipText/labels are inadequate, try the following:-

Add a new property called UseHelp to the data entry form

Add a Checkbox, caption "Data entry help" or similar.
In the valid event of the Checkbox:-

*--
WAIT CLEAR
IF THIS.Value = 0
THISFORM.UseHelp = .F.
ELSE
THISFORM.UseHelp = .T.
* WAIT WINDOW [Click where you need help...] ;
NOWAIT NOCLEAR && Optional message
ENDIF
*--

In the GotFocus event of all enabled controls

*--
IF THISFORM.usehelp
WAIT WINDOW ;
[Enter the date on which etc] ;
+CHR(13) ;
[xxxx xxxx xxx x xxx x xxxxxx] ;
+CHR(13) ;
+CHR(13) ;
+[This date is required etc] ;
+CHR(13) ;
[xxxx x xxxxxx x xx xxxxxx] ;
NOCLEAR NOWAIT
ELSE
WAIT CLEAR
ENDIF
*--
Keep the length of the message sections to approximately the same number of characters, which will format the window correctly.

To position the window in relation to a control, add the "AT nRow,nColumn" argument - the following code will convert pixels to nRow or nCol.

nExtra = 8 && Adjustment for menu and toolbar
nRow = (THIS.Control.Top / 16) + nExtra
nCol = (THIS.Control.Left + THIS.Control.Width) / 6
WAIT WINDOW [Message] ;
AT nRow,nCol NOCLEAR NOWAIT


In the LostFocus event of the control

*--
WAIT CLEAR
*--

The Checkbox enables/disables the context sensitive help.

This code is not designed to replace conventional help files or ToolTipTexts/labels, but to supplement them.

* DISCLAIMER
* This Code is as is.  There is no warranty expressed or
* implied.  Use this code at your own risk.

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close