Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stupid attack
Message
From
02/04/2004 09:21:36
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
02/04/2004 01:07:53
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00891611
Message ID:
00891736
Views:
26
Al,
Modal or non-modal, no effect. It's a new day so hopefully I'll see the glaringly obvious flaw in what I'm doing and sheepishly pass it along. Thanks.

Gary


>>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)?
Previous
Reply
Map
View

Click here to load this message in the networking platform