Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00619208
Message ID:
00698160
Vues:
20
Marcia, I've been trying to use essentially this code, but when I type the first character, I get the first item in the list. If I backspace and hit it again, I get the correct item. Does this sound at all familiar? Thanks.

(And yes, I know that the proper answer to this is "go buy Kilofox". :-) )

>Well, this code, in my quickfill combo class works fine for me <s>.
>
>This code in InteractiveChange:
>
>*** handle the key...IOW, find the closest match in the list
>IF This.SelStart > 0
>	IF ( LASTKEY() > 31 AND LASTKEY() < 128 ) OR ( LASTKEY() = 7 )
>	   This.HandleKey()
>	ENDIF
>ENDIF
>
>
>HandleKey method:
>
>LOCAL lcSofar, lnSelStart, lnSelLength, lnRow
>
>WITH This
>  *** Handle backspace key
>  IF LASTKEY() = 127
>    .SelStart = .SelStart - 1
>  ENDIF	
>  *** Get the value typed in so far
>  lnSelStart = .SelStart
>  lcSofar =  LEFT( .DisplayValue, lnSelStart )
>  *** Find a match in column #1 of the combo's internal list
>  FOR lnRow = 1 TO .ListCount
>    IF UPPER( .List[ lnRow, 1 ] ) = UPPER( lcSoFar )
>      .ListIndex = lnRow
>      EXIT
>    ENDIF
>  ENDFOR		
>  *** Highlight the portion of the value after the insertion point
>  .SelStart = lnSelStart
>  lnSelLength = LEN( ALLTRIM( .DisplayValue ) ) - lnSelStart
>  IF lnSelLength > 0
>    .SelLength =  lnSelLength	
>  ENDIF	
>ENDWITH
>
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform