Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying Help Info from a property?
Message
 
To
04/12/1998 09:15:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164045
Message ID:
00164118
Views:
25
>I would like to be able to write some notes regarding a form that imports data. Specifically I would like to create a 'zreadme' method and be able to display the contents of the zreadme method if a user clicks on a 'Help' button. The zreadme method would have the details surrounded by TEXT ... ENDTEXT. I do not want to create a seperate table with a memo field to show the help notes.
>
>Can I do something like this?

Tom, sure you can.

I don't know where do you want to display the help text, let's make it in the pop-up editbox
You place editbox say, edtComment on the form, set
edtComment.Visible = .f.,
edtComment.ReadOnly = .t.

In your Form.zreadme() method you place
TEXT&&
My helptext is about....
....
and it ends here.
ENDTEXT&&
In your HelpButton.Click() you place the following code:
**cmdHelp.Click()
lcText = thisform.ReadMethod("zreadme")
lcNote = CHR(38)+CHR(38) 
lcText = strtran(lcText, "ENDTEXT"+lcNote, "")
lcText = strtran(lcText, "TEXT"+lcNote, "")
* strip off CR/LF which may be in the beginning of text
lcText = alltrim(lcText)
DO WHILE LEFT(lcText, 1) = CHR(13) OR LEFT(lcText, 1) = CHR(10)
	lcText = RIGHT(lcText,len(lcText)-1)
ENDDO
thisform.edtComment.value = lcText
thisform.edtComment.Visible = .t.
thisform.edtComment.ZOrder(0)
thisform.edtComment.SetFocus()
In edtComment.KeyPress()
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27 && ESC closes the editbox
	this.Visible = .F.
	this.ZOrder(1)
ENDIF
In edtComment.LostFocus()
you may put
this.KeyPress(27)
to get rid of editbox if you clicked on something else.
You can take this as a sample and elaborate on the functionality if you want.

HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform