Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form exiting using the exe
Message
De
23/09/2003 02:46:30
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
23/09/2003 01:20:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00828383
Message ID:
00831340
Vues:
10
Evelyn,

No bother ...

A READ EVENTS does not typically go "inside" a Form.

A typical application starts by doing some initializing, adds a menu, and then issues a READ EVENTS. From there on, usually via the menu, the User runs forms, reports, etc.

It sounds like you want to run a "Logon" form, and then run some other form. I'm including a small sample that (I think) reflects what you're trying to do ... Plug in your own logic and forms. Hope it helps.
*//////////////////////////////////////
*  Sample for UT
*//////////////////////////////////////

   LO_Log = CREATEOBJECT( "Log_Form" )
   LO_Log.Show( 1 )        && Modal.

   IF LO_Log.L_Logon = .F.
      = MESSAGEBOX( "Logon failed; Quiting..." )
      RETURN .F.           && Logon failed
   ENDIF

   LO_Time = CREATEOBJECT( "Time_Form" )
   LO_Time.Show()          && Modeless.

   READ EVENTS

   = MESSAGEBOX( "Good Bye" )

*//////////////////////////////////////
DEFINE CLASS Log_Form AS Form
*//////////////////////////////////////
   L_Logon = .F.

   ADD OBJECT cmd_Logon AS CommandButton WITH Caption = "Logon"
   ADD OBJECT cmd_Logoff AS CommandButton WITH Caption = "Logoff", Top = 40

PROCEDURE QueryUnload
   NODEFAULT            && Prevent "X" from quiting.

PROCEDURE cmd_Logon.Click
   THISFORM.L_Logon = .T.
   THISFORM.Hide()      && Exits modal processing.

PROCEDURE cmd_Logoff.Click
   THISFORM.L_Logon = .F.
   THISFORM.Hide()      && Exits modal processing.
ENDDEFINE

*//////////////////////////////////////
DEFINE CLASS Time_Form AS Form
*//////////////////////////////////////

   ADD OBJECT txt_1 AS TextBox
   ADD OBJECT txt_2 AS TextBox WITH Top = 40

PROCEDURE Init
   = MESSAGEBOX( "Click 'X' Button to close Form" + CHR( 10 ) + ;
                 "and exit READ EVENTS loop" )
PROCEDURE QueryUnload
   CLEAR EVENTS
ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform