Auto-Fill Edit Control | CodeGuru

Auto-Fill Edit Control

Environment: Windows 98, Visual C++ 5.0 A fine class for lazy operators 🙂 This is an enhanced edit class: it allows to reduce the input time recording the words previously inserted and showing them when some letters are typed. This class is generated starting from CEdit, and can store up to 128 (but it’s possible […]

Written By
CodeGuru Staff
CodeGuru Staff
Jan 25, 2000
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Windows 98, Visual C++ 5.0

A fine class for lazy operators 🙂

This is an enhanced edit class: it allows to reduce the input time recording
the words previously inserted and showing them when some letters are typed.

This class is generated starting from CEdit, and can store up to 128 (but
it’s possible to change this limit) words; it’s use is really easy: all you have
to do are the following steps:


  1. design your own CDialog or CFormView (or derived class) inserting the
    standard editbox;
  2. include AFEdit.h & AFEdit.cpp in your project;
  3. in the CXYZ.h file generated for the dialog (or view) include AFEdit.h and
    replace all CEdit with CAFEdit;
  4. in the OnInitDialog (or OnInitialUpdate) add the strings you want to be
    inserted in the words list for each editbox;

Every time you insert a new word in a specific editbox, the relative list
will growth if necessary (no duplication). Of cource, if the class is deleted
all data are lost. I tested it in a multiline editbox too, and it works fine.

There is only one known problem: in a multiline editbox the pair CTRL-TAB
insters a tab int the text, the source I wrote isn’t still able to intercept
that couple 🙁

In debug mode a doubleclick on an editbox shows a dialog with
the entire list.

Downloads

Download demo project and source code – 13 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.