Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Saurabh Samir
  Where is Saurabh Samir?
 Ahmedabad
 India
 Saurabh Samir
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
Subject: RE: Interacting with user without messagebox
Thread ID: 464600 Message ID: 464607 # Views: 48 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Thursday, March 28, 2019 10:22:17 AM         
   



> > 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...

ENTIRE THREAD

Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 9:18:36 AM
RE: Interacting with user without messagebox Posted by Tore Bleken @ 3/28/2019 9:26:16 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 9:41:33 AM
RE: Interacting with user without messagebox Posted by Tore Bleken @ 3/28/2019 9:53:24 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 10:01:33 AM
RE: Interacting with user without messagebox Posted by Tore Bleken @ 3/28/2019 10:16:57 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 10:28:38 AM
RE: Interacting with user without messagebox Posted by Stefan Wuebbe @ 3/28/2019 10:07:57 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 10:22:17 AM
RE: Interacting with user without messagebox Posted by Stefan Wuebbe @ 3/28/2019 10:35:49 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 11:00:33 AM
RE: Interacting with user without messagebox Posted by Stefan Wuebbe @ 3/28/2019 11:44:58 AM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/28/2019 12:18:37 PM
RE: Interacting with user without messagebox Posted by Vilhelm-Ion Praisach @ 3/28/2019 1:09:08 PM
RE: Interacting with user without messagebox Posted by Jose Martin Hernandez @ 3/28/2019 4:17:02 PM
RE: Interacting with user without messagebox Posted by Vilhelm-Ion Praisach @ 3/29/2019 11:23:20 AM
RE: Interacting with user without messagebox Posted by Jose Martin Hernandez @ 3/29/2019 4:22:04 PM
RE: Interacting with user without messagebox Posted by Saurabh Samir @ 3/29/2019 5:22:18 AM
RE: Interacting with user without messagebox Posted by Vilhelm-Ion Praisach @ 3/29/2019 11:26:09 AM