> > Respected members,
> > Messagebox returns 6, .T., .F., etc.
> > But it has it's own flavor of size and look.
> > I wanted to present one line message inside a box inscribing that message to user expecting enter for accepting and escape for rejecting.
> > I designed a modal form and a label on it. Then written on form's keypress the code for escape and enter to return .F. or .T.
> > But this is not working.
> > What would be the best way for me to work it out.
> > The label on the same form (where I want user's interaction) is not good as execution does not stop at the point. And Messagebox is not wanted.
> > -----------------------------------------
> > Best Regards
> > A Beginner, not only of VFP...
>
>
> What do you mean when you say "is not working"?
>
> If your Form.KeyPress() code does not run, you may need to set Form.KeyPreview=.T.
>
> You would however not need Form.KeyPress() if you'd have an "okButton" on the Form with the okButton.Default property being .T.
> That one would handle the Enter key automatically, i.e. its Click() event would run.
> And a "cancelButton" could do the same for the Esc key when its .Cancel property is .T.
>
>
>
> hth
> -Stefan
Thanks for the reply.
I tried without button.
Keypreview is .T. and the keypress is working.
On my program I have called it like-
If Continue(TopV,LeftV,'Book was issued to '+AgentV+'. Continue?')
* append in RBNO_List
* delete mark in rbno list
Else
Return .F.
ENDIF
Here Continue.prg has keypress and init of form having only one label.
Continue.prg also has Caption_Assign() which resizes form according to Autosized label's Height and Width.
But the problem is
Continue() always returns .T. (even when Return .F. is written on escape.
-----------------------------------------
Best Regards
A Beginner, not only of VFP...