This is a sample that shows the use of the TSearchBox control.
You can find the SearchBox sample project at:
- Start | Programs | Embarcadero RAD Studio Alexandria | Samples and then navigate to either:
- Subversion Repository:
- You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
The application uses the following controls:
SB: The search box.
lstLog: The listbox for the feedabck messages.
grpBiDiMode: The radio buttons that allow you to change the BiDiMode.
grpSearchIndicator: The radio buttons that allow you to change the search indicatior icon.
chkEnabled: Enables or disables the search box.
cbxVclStyles: A combo box that allows you to change the style of the application. You can choose between any style that is active in the Application Appearance - Custom Styles options for this project.
How to Use the Sample
- Navigate to one of the locations given above and open:
- Delphi: SearchBox.dproj.
- C++: SearchBox.cbproj.
- Press F9 or choose Run > Run.
- Change the different options on the form and test the search box functionality. Type into the search box and press
Enteror click the search indicator button.
On initialization, the
FormCreate adds all the active styles to the
cbxVclStyles combo box.
- The application defines the following event handlers:
grpSearchIndicatorClick: Changes the SearchIndicator type.
cbxVclStylesChange: Sets the style for the application.
chkEnabledClick: Enables or disables the search box.
grpBiDiModeClick: Changes the BiDiMode.
SBInvokeSearch: Responds to the OnInvokeSearch event of TSearchBox. Calls the
Logmethod and passes the input from the search box.
- The application also defines the following methods:
Log: Adds the received text to the listbox.