> 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