Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 Tags
Subject: RE: xBox Control Class
Thread ID: 416033 Message ID: 416035 # Views: 100 # Ratings: 1
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Friday, December 19, 2014 7:40:49 AM         
   


> > Here is a new class you might be interested:
> >
> > http://sandstorm36.blogspot.com.au/2014/12/xbox-textbox-control-class.html
> >
> >
> > Cheers!
> >
> >
> > https://vfpx.codeplex.com/releases/view/99045
> > http://sandstorm36.blogspot.com
>
> Impeccable, as always!
>
> Respectfully

Thank you Vilhelm. Actually during my fooling with codes yesterday, I forgot to trap the Delete key plus I used two properties instead of one on trapping the keypresses. So I actually borrowed your trapping approach there. :-)

See below, I used two properties instead of your one:

Local FormFill As Form

FormFill = Createobject('form1')
FormFill.Show()
Read Events

Define Class form1 As Form
	Height = 100
	Width = 420
	AutoCenter = .T.
	Caption = "Textbox AutoFill/Incremental Search"
	Name = "Form1"
	ShowTips = .T.

	Add Object text1 As TextBox With ;
		Format='!',;
		Width = 400,;
		Top = 10,;
		Left = 10,;
		BackSpace = .F.,;
		SpaceBar = .F.

	Procedure Load
	Close Databases All
	Use _samples+'Data\orders' Alias orders In 0 Shared
	Endproc

	Procedure text1.Init
	Set Exact Off
	Endproc

	Procedure text1.KeyPress
	Lparameters nKeyCode, nShiftAltCtrl
	This.BackSpace = Iif(m.nKeyCode=127,.T.,.F.)
	This.SpaceBar = Iif(m.nKeyCode=32,.T.,.F.)
	Endproc

	Procedure text1.InteractiveChange
	If  This.SpaceBar = .F.  And This.BackSpace = .F.
		Local lcValue
		lcValue = Alltrim(This.Value)
		Locate For Upper(to_name) = m.lcValue
		If Found()
			This.Value = Alltrim(to_name)
			This.SelStart= Len(m.lcValue)
			This.SelLength=Len(This.Value)-Len(m.lcValue)
		Endif
	Endif
	Endproc

	Procedure Destroy
	Clear Events
	Endproc

Enddefine


If I can rate your post more than once yesterday, I would have done that. Because I can see where something like this auto-complete can become useful, at least on my end.


https://vfpx.codeplex.com/releases/view/99045
http://sandstorm36.blogspot.com

ENTIRE THREAD

xBox Control Class Posted by Jun Tangunan @ 12/19/2014 6:53:26 AM
RE: xBox Control Class Posted by Vilhelm-Ion Praisach @ 12/19/2014 7:16:02 AM
RE: xBox Control Class Posted by Jun Tangunan @ 12/19/2014 7:40:49 AM
RE: xBox Control Class Posted by Cesar @ 12/19/2014 10:44:34 AM
RE: xBox Control Class Posted by Jun Tangunan @ 12/19/2014 11:06:45 AM
RE: xBox Control Class Posted by Andrew Nickless @ 12/19/2014 9:17:42 PM
RE: xBox Control Class Posted by Cesar @ 12/20/2014 3:05:42 AM
RE: xBox Control Class Posted by Jun Tangunan @ 12/20/2014 5:14:13 AM
RE: xBox Control Class Posted by Alejandro Garcia @ 12/19/2014 11:02:40 PM
RE: xBox Control Class Posted by Jun Tangunan @ 12/22/2014 4:49:23 AM
RE: xBox Control Class Posted by chaim dudi @ 12/21/2014 2:19:28 PM
RE: xBox Control Class Posted by Jun Tangunan @ 12/21/2014 9:44:27 PM
RE: xBox Control Class Posted by Saifuddin Hussain @ 12/22/2014 8:53:35 AM