Creating a Filter Combo Box
|
|
To help you create a filter or a set of filters to apply
to a file list box, the VCL provides the filter combo box. To visually
create a filter combox, in the Win 3.1 section of the Tool Palette, click
the TFilterComboBox control
and click the form (or container). In the VCL, the filter combo box is
represented by the TFilterCombBox class.
Practical
Learning: Adding a Filter Combo Box
|
|
- In the Tool Palette, click Win 3.1
- Click the TFilterComboBox control
and click inside the frame
- Adjust the design as follows:
Before a filter combo box can play its role, you must
create its filter(s). A filter is a string that is made of one or more
internal sections. Each section is in the form:
File Category (*.Extension)|*.Extension
For the File category, enter a short
description of the type of file. Provide an extension in the Extension
placeholder(s). If you want to include more than one section, separate them
with |. Here is an example:
HTML Files (*.htm)|*.htm|Perl Script (*.pl)|*.pl
To assist you with creating a filter, Embarcadero RAD
Studio provides the Filter Editor dialog box.
Practical
Learning: Creating a Filter
|
|
- In the frame, click the filter combo box
- In the Object Inspector, click Filter, then click its button
- Complete the Filter Editor as follows
- Click OK
|