Style Search

Created:11/2/2000
Description:

This sample demonstrates how to search symbol names within a Style Gallery. Multiple styles can be searched at the same time. The results will be listed within the form and will include the name of the style, name of the symbol and the type of symbol. The search can be performed on an individual symbol type or made to encompass all the symbols within the style.

How to use:
  1. In the Customize dialog, click on 'Add from file' and select this sample's dll.
  2. Under the Commands tab, select the 'Style Search' command from the 'Developer Samples' category, and drag it on to the Tools/Styles pull-right menu. Dismiss the Customize dialog.
  3. Click the Style Search command. Browse to the folder that contains the styles you wish to search. Select one or more styles and enter a search string. Choose the type of search operation you wish to perform. The choices are: Equals - the entire string will be used to find matching symbol names, Contains - the string is within a symbol name, Begins with - the string is the beginning of a symbol name, or Ends with - the string is the ending of a symbol name. Select which symbol or symbol types will be searched. Press the Search button to begin. The results will be displayed and the number of hits will be returned as well.
  4. Selecting a symbol from the results window will display a preview of that symbol. When the selected symbol is from a style which is not currently referenced, you will be given the opportunity to add the style for use within ArcMap.

Application:
ArcMap

Difficulty: Moderate


Visual Basic
File Description
StyleSearch.cls Module containing the command.
StyleSearch.frm VB form file holding resources used within project.
StyleSearch.bas Module containing the search utility.
StyleSearch.vbp Visual Basic project file.
StyleSearch.dll The compiled component.


Key CoClasses: Database, Recordset
Key Interfaces: IApplication, IStyleGallery, IStyleGalleryStorage, IStyleGalleryItem, IMxDocument, ICommand