Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display modal form on startup
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00669077
Message ID:
00669982
Vues:
16
So, your login form is the top-level form? Is frmMain also a top-level form? As has already been mentioned, you can't make a top-level form modal. There's no way around that.

I haven't tried this, but one workaround for you may be to call frmMAIN with the NOSHOW clause. The frmLogin.Release() should be taken out because that's going to close the login form right away. With the NOSHOW on the main form, the login form should be the only form that's visible. After the user logs in successfully, you can set the Visible property on the main form to .T. and release the login form.

>Hi,
> Yes, I have set my form as modal form. However, the form not appear on startup. The following is my code and form property.
>
>
>*--Main.prg
>
>DO FORM frmLogin
>lcResp = frmLogin.lcReturnValue
>frmLogin.RELEASE()
>
>IF lcResp = "FAILED-"
>   RETURN .F.
>ENDIF
>
>DO FORM frmMain NAME frmMain
>READ EVENTS
>
>
>*--frmLogin's property
>
>#INCLUDE "c:\windows\desktop\shc-membership\resources\messagebox.h"
>*
>DEFINE CLASS frmlogin AS modalformbase
>	ShowWindow = 1
>	DoCreate = .T.
>	Closable = .F.
>	MDIForm = .F.
>	Icon = "..\graphics\xpuser-key.ico"
>	AlwaysOnTop = .T.
>	lcreturnvalue = ("")
>	Name = "FRMLOGIN"
>
>ENDDEFINE
>*
>*-- EndDefine: frmlogin
>**************************************************
>
>DEFINE CLASS modalformbase AS formbase
>	Height = 250
>	Width = 375
>	DoCreate = .T.
>	AutoCenter = .T.
>	Caption = "Base Modal Form"
>        Desktop = .T.                   && I tried to set desktop as .T. and .F., but don't work
>	MaxButton = .F.
>	MinButton = .F.
>	WindowType = 1
>	Name = "modalformbase"
>	lcreturnvalue = .F.
>ENDDEFINE
>
>
>
>Any ideas?
>
>Thank you
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform