Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stupid attack
Message
De
02/04/2004 01:07:53
 
 
À
01/04/2004 16:58:44
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00891611
Message ID:
00891667
Vues:
24
>Hi all,
>I'm having one of the above and need help. I have a form(scx) that instantiates a form class to get a password. The password form does the classic instantiate and destroy in a flash making it impossible to get user input. I must have done this type of thing a thousand times and all of a sudden I'm stumped. Below is some of the relevent code.
>
>If the settle form is run directly, the password form stays up.
>
>If the main.prg code runs either in IDE or exe, the password form will not stay up for input.
>
>VFP 8 sp1
>
>*-- Code in small MAIN.prg in the exe
>LOCAL oReport
>SET SAFETY OFF
>_screen.Visible = .F.
>DO FORM forms\settle && Has a button to call for the form class
>READ EVENTS
>
>
>*-- Button code on settle form
>PROCEDURE Click
> LOCAL oForm
> LOCAL cPassword
> oForm = NEWOBJECT('frmPassword','libs\utility.vcx')
> oForm.Show() && Form has a CloseForm method with Hide()
>
> READ EVENTS && This needed in the IDE, no use in executable of course.
>
> this.cPassword = oForm.cPassword
>
>RETURN
>
>
>*-- Form class code from class browser
>DEFINE CLASS frmpassword AS Form
> Height = 85
> Width = 274
> ShowWindow = 2
> DoCreate = .T.
> AutoCenter = .T.
> BorderStyle = 2
> Caption = "Database Login"
> ControlBox = .F.
> Closable = .F.
> WindowType = 0
> cPassword = ""
> Name = "frmpassword"
>
> ADD OBJECT txtpassword AS textbox WITH ;
> Height = 24, ;
> Left = 80, ;
> TabIndex = 1, ;
> TerminateRead = .T., ;
> Top = 46, ;
> Width = 114, ;
> PasswordChar = "*", ;
> Name = "txtPassword"
>
>
> ADD OBJECT label1 AS label WITH ;
> FontBold = .T., ;
> FontSize = 10, ;
> BackStyle = 0, ;
> BorderStyle = 0, ;
> Caption = "Please enter your database password", ;
> Height = 18, ;
> Left = 14, ;
> Top = 18, ;
> Width = 246, ;
> TabIndex = 4, ;
> Name = "Label1"
>
>
> PROCEDURE txtpassword.Valid
> *-- User types in password and hits ENTER
> thisform.cPassword = ALLTRIM(thisform.txtPassword.Value)
> thisform.Hide()
> ENDPROC
>
>ENDDEFINE

What if you set WindowType = 1 (Modal)?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform