Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unbound Date Textbox doesn't get focus when NULL
Message
De
03/12/2003 07:40:20
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00855359
Message ID:
00855366
Vues:
8
Hi Armin,

as a workaround I would suggest (untested)
*somewhere in (textboxes) init
lcProp = sys(2015)
.textbox.addproperty(lcProp,.textbox.value)
.textbox.controlsource = 'THIS.'+lcProp
now you have a (meaningless) controlsource and it should work.
HTH

Agnes
>Hi,
>
>just wanted to ask you for your opinion on this (thinking of submitting this as a bug) ...
>
>If you have an unbound textbox with its format property set to "D" and you are setting the value property to NULL programmatically, you cannot get into the textbox with neither mouse usage nor tab into it. After the GotFocus() event, the Valid() is fired immediately. If the textbox is bound, everything works fine.
>
>Since the GotFocus() event fires, a workaround is easy: Checking for NULL in GotFocus and setting the value to {} helps. In the LostFocus event an empty date could be set back to NULL.
>
>Same behaviour in VFP7SP1 and VFP8SP1.
>
>Thanks for your input,
>Armin
>
>
>**************************************************
>*-- Class:        test (c:\mmortals\sis\sispat\test.vcx)
>*-- ParentClass:  form
>*-- BaseClass:    form
>*-- Time Stamp:   12/03/03 12:55:09 PM
>*
>DEFINE CLASS test AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 157
>	Width = 289
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT text1 AS textbox WITH ;
>		Alignment = 3, ;
>		Value = ({}), ;
>		ControlSource = "test.f1", ;
>		Format = "D", ;
>		Height = 23, ;
>		Left = 24, ;
>		Top = 48, ;
>		Width = 100, ;
>		Name = "Text1"
>
>
>	ADD OBJECT command1 AS commandbutton WITH ;
>		Top = 96, ;
>		Left = 24, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Set NULL", ;
>		Name = "Command1"
>
>
>	ADD OBJECT text2 AS textbox WITH ;
>		Alignment = 3, ;
>		Value = (DATE()), ;
>		Format = "D", ;
>		Height = 23, ;
>		Left = 168, ;
>		Top = 48, ;
>		Width = 100, ;
>		Name = "Text2"
>
>
>	ADD OBJECT command2 AS commandbutton WITH ;
>		Top = 96, ;
>		Left = 168, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Set NULL", ;
>		Name = "Command2"
>
>
>	ADD OBJECT label1 AS label WITH ;
>		AutoSize = .T., ;
>		Caption = "Bound", ;
>		Height = 17, ;
>		Left = 24, ;
>		Top = 12, ;
>		Width = 38, ;
>		Name = "Label1"
>
>
>	ADD OBJECT label2 AS label WITH ;
>		AutoSize = .T., ;
>		Caption = "NOT bound", ;
>		Height = 17, ;
>		Left = 168, ;
>		Top = 12, ;
>		Width = 65, ;
>		Name = "Label2"
>
>
>	PROCEDURE Load
>		CREATE CURSOR test (f1 D NULL)
>		INSERT INTO test (f1) VALUES (DATE())
>	ENDPROC
>
>
>	PROCEDURE Unload
>		USE IN SELECT("test")
>	ENDPROC
>
>
>	PROCEDURE command1.Click
>		thisform.text1.Value = null
>	ENDPROC
>
>
>	PROCEDURE command2.Click
>		thisform.text2.Value = null
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: test
>**************************************************
>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform