Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Autocomplete, mouse, and error
Message
From
07/10/2005 10:05:26
 
 
To
06/10/2005 22:02:23
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01055395
Message ID:
01057168
Views:
61
It would be nice if you could point the problem and give some workaround.

PMFJI, but I already reported this problem. Here is the work around:
**************************************************
*-- Class:        txtautofill (f:\wwnew\libs\stdtxt.vcx)
*-- ParentClass:  txtbase (f:\wwnew\libs\basectrl.vcx)
*-- BaseClass:    textbox
*-- Time Stamp:   09/19/05 03:36:06 PM
*-- Autofill text box that has functionality to automagically drop the list when it gets focus
*
DEFINE CLASS txtautofill AS txtbase


	Height = 23
	MaxLength = 20
	TabIndex = 10
	Width = 150
	AutoComplete = 1
	AutoCompTable = "data\autocomp.dbf"
	*-- Used to store the control's real control source to work around a bug in VFP that causes a creash when this is a bound control on a form with a private data session
	ccontrolsource = ""
	Name = "txtautofill"


	*-- Called from the GotFocus() to automagically drop the list
	PROCEDURE droplist
		IF EMPTY( This.Value )
		  KEYBOARD '{SPACEBAR}' PLAIN CLEAR 
		ENDIF
	ENDPROC


	*-- Called from the controls Refresh() to update its value from its cControlSOurce
	PROCEDURE refreshvalue
		LOCAL lcControlSource
		WITH This
		  IF NOT EMPTY( .cControlSource )
		    lcControlSource = .cControlSource
		    .Value = &lcControlSource 
		  ENDIF
		ENDWITH  
	ENDPROC


	*-- Called from the control's valid to update its cControlSource
	PROCEDURE updatecontrolsource
		LOCAL lcAlias, lcControlSource
		WITH This
		  IF NOT EMPTY( .cControlSource )
		    lcAlias = JUSTSTEM( .cControlSource )
		    IF UPPER( LEFT( lcAlias, 4 ) ) = 'THIS'
		      lcControlSource = .cControlSource
		      STORE .Value TO &lcControlSource 
		    ELSE
		      REPLACE ( .cControlSource ) WITH .Value IN ( lcAlias )
		    ENDIF
		  ENDIF
		ENDWITH  
	ENDPROC


	PROCEDURE Refresh
		This.RefreshValue()
		DODEFAULT()
	ENDPROC


	PROCEDURE Init
		DODEFAULT()
		*** Unbind the control to work around a bug in VFP
		*** that causes a crash when it is bound and in a private DS
		WITH This
		  IF EMPTY( .cControlSource )
		    .cControlSource = .ControlSource 
		    .ControlSource = []
		  ENDIF
		ENDWITH
	ENDPROC


	PROCEDURE GotFocus
		DODEFAULT()
		This.DropList()
	ENDPROC


	PROCEDURE Valid
		This.UpdateControlSource()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: txtautofill
**************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform