Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent form re loading
Message
 
 
To
10/02/2002 10:13:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00618011
Message ID:
00618074
Views:
18
>Hi
>
>what is the best way of preventing a form being loaded more than once. SO if a copy of its already open I don't want another.
>
>
>Nick Mason

You can check Forms collection. Something like
llFormIsRunning = .F.
For Each loForm IN _Screen.Forms
  IF loForm.Name = < the name of the form to run >
      * the form is running alreday
     llFormIsRunning = .T.
     loForm.Show()
     Exit
  ENDIF
Endfor

If Not llFormIsRunning 
  DO Form < the name of the form to run > 
Endif
You can also create a form manager in your application object an let it handle that.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform