Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Button click after textbox valid doesn't fire?
Message
De
02/12/2005 20:54:18
 
 
À
02/12/2005 17:54:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Divers
Thread ID:
01074348
Message ID:
01074503
Vues:
19
Unfortunately, I'd really like to stay away from the Wait Window for this particular thing and use a messagebox.

It looks like Doru's method is the best way for me.

Thanks Fabio.

>>Running vfp9 on WinXP SP2.
>>
>>When I have a messagebox in a textbox valid, and, with the textbox having focus, I click on a button, the button's click event doesn't fire. Is this a bug, or is it supposed to happen this way?
>>
>>Here is some simple code. Note that if you change command1.click to command1.rightclick, the rightclick event will fire which makes me lean toward it being a bug.
>>
>>I thought it might make a difference if the messagebox didn't have to be closed manually, so I tried changing the
MessageBox("TextBox Valid")
to be
MessageBox("TextBox Valid",0,2000)
But it makes no difference. The button click doesn't fire.
>>
>>Anybody?
>
>try this with and without NOWAIT:
>
>oForm = CREATEOBJECT("Form1")
>oForm.Show(1)
>
>
>RETURN
>
>DEFINE CLASS form1 AS form
>  DoCreate = .T.
>  Caption = "Form1"
>  Name = "Form1"
>
>  ADD OBJECT text1 AS textbox WITH ;
>    Height = 23, ;
>    Left = 96, ;
>    Top = 48, ;
>    Width = 100, ;
>    Name = "Text1"
>
>  ADD OBJECT command1 AS commandbutton WITH ;
>    Top = 120, ;
>    Left = 96, ;
>    Height = 27, ;
>    Width = 84, ;
>    Caption = "Command1", ;
>    Name = "Command1"
>
>  Procedure Destroy
>    Clear Events
>  ENDPROC
>
>  PROCEDURE text1.Valid
>    WAIT WINDOW "TextBox Valid" && NOWAIT
>  ENDPROC
>
>  PROCEDURE command1.Click
>    MESSAGEBOX("button click")
>  ENDPROC
>
>ENDDEFINE
>
>
>Without NOWAIT the the event LEFTBUTTON UP is consumed by the WAIT command.
>I don't believe gives a bug but a limit of the VFP program model.
>
>As WAIT WINDOW it interrupts the code, VFP cannot perform MouseUp/Click,
>but if it didn't consume the event, VFP would go into a deadlock.
>
>The only solution is to manage the events with a stack,
>but then the program model would be very different (and best).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform