Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <a href="http://msdn.microsoft.com/en-us/library/bb776292.aspx" rel="noreferrer">autocompletion feature</a> built in to all Windows edit controls.</p> <p>First, fill your <code>TStrings</code> object however you want. Then use <a href="http://docwiki.embarcadero.com/VCL/en/AxCtrls.GetOleStrings" rel="noreferrer"><code>GetOleStrings</code></a> to create a <a href="http://docwiki.embarcadero.com/VCL/en/AxCtrls.TStringsAdapter" rel="noreferrer"><code>TStringsAdapter</code></a> to wrap it. (The adapter does not claim ownership of the <code>TStrings</code> object, so you must make sure you don't destroy it while the adapter is still live.) The adapter gives you an <code>IStrings</code> interface, which you'll need because the autocompletion feature requires an <a href="http://msdn.microsoft.com/en-us/library/ms687257.aspx" rel="noreferrer"><code>IEnumString</code></a> interface to provide the completion matches. Call <a href="http://docwiki.embarcadero.com/VCL/en/AxCtrls.TStringsAdapter._NewEnum" rel="noreferrer"><code>_NewEnum</code></a> for that.</p> <p>Next, call <a href="http://msdn.microsoft.com/en-us/library/ms686615.aspx" rel="noreferrer"><code>CoCreateInstance</code></a> to create an <a href="http://msdn.microsoft.com/en-us/library/bb776292.aspx" rel="noreferrer"><code>IAutoComplete</code></a> object. Call its <a href="http://msdn.microsoft.com/en-us/library/bb776293.aspx" rel="noreferrer"><code>Init</code></a> method to associate it with the window handle of your edit control. If you're using a combo box, then send it a <a href="http://msdn.microsoft.com/en-us/library/bb775772.aspx" rel="noreferrer"><code>cbem_GetEditControl</code></a> message to find the underlying edit window.</p> <p>You can stop at that point and autocompletion should work automatically. You can disable autocompletion if you want, or you can set any number of <a href="http://msdn.microsoft.com/en-us/library/bb762479.aspx" rel="noreferrer">autocompletion options</a>.</p> <p>You say you don't want autocompletion, but in the OS terminology, I think what you really don't want is called <strong>auto append</strong>, where the remainder of the string is entered into the edit box automatically as the user types, but selected so that further typing will overwrite it, and the user needs to delete the excess text if the desired value is shorter than one of the matches. </p> <p>There is also <strong>auto suggest</strong>, which displays a drop-down list of suggestions. </p> <p>You can enable either or both options. You don't need to filter the list of suggestions yourself; the autocomplete object filters the <code>IEnumString</code> list by itself.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload