Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box AutoComplete Property?
Message
From
08/05/2007 06:52:36
 
 
To
07/05/2007 14:49:34
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01223142
Message ID:
01223309
Views:
18
Is there such a thing as AutoComplete property in combo box? Or similar? Please help.

The combo box has an incrementalSearch property which is true by default. However, the time interval at which the search string is reset is controlled by a sustem variable called _INCSEEK and this is generally too short to allow for oratical incrememtal searching. So you can create a custom combo class to handle this like so:
Define Class cbobase As combobox
  BoundTo = .T.
  DisplayCount = 15
  *-- Save original value of _INCSEEK in SetCombo (called from combo's GotFocus) so it can be restored in LostFocus...aid to incremental searching
  noldincseek = 0
  Name = "cbobase"

  *-- Used to hold RowSource when the RowSourceType is 5-Array
  Dimension acontents[1]

  *-- Sets _INCSEEK if incrementalSearch = .T. and selects on entry correctly
  Procedure GotFocus
    With This
      .noldincseek = _Incseek
      If .IncrementalSearch
        *** Set interval of _INCSEEK high enough if we are using VFP's
        _Incseek = 2.5
      Endif
    Endwith
  Endproc

  Procedure LostFocus
    _Incseek = This.noldincseek
  Endproc
Enddefine
Previous
Reply
Map
View

Click here to load this message in the networking platform