Recently used files - Command, MultiItem, and ToolControl


This document was published with and applies to ArcGIS 9.3.
A 10 version also exists. A 9.2 version also exists.
PurposeThis sample shows how to implement different styles of custom commands, normal button command, ToolControl, and MultiItem command, to customize ArcGIS Desktop applications. All three types of commands perform the same functionality—to list and open the recently used documents. It also shows how to create custom toolbars and menus with your custom commands.

Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Open and compile the sample project in Visual Studio. Set up debug application if needed.
  2. This sample works in ArcMap, ArcScene, or ArcGlobe. Open any of the applications.
  3. Turn on the Recent Files (C#) or Recent Files (VB) toolbar from the Customize dialog box or toolbar list, depending on the language project you have compiled.
  4. Expand the Recent Files menu to interact with the command and MultiItem command to open any of the recently used documents.
  5. You can also open a document in the Recent Files list with the dropdown list tool control.

Additional information

When you run the toolbar created by this sample, you will see the following Command, MultiItem, and ToolControl:
 
 


CommandRecentFiles.cs Command displaying the recent files in a dialog box in OnClick
FormRecentFiles.cs Form with a list box to select recent files to open
MultiItemRecentFiles.cs MultiItem command listing the recent files as a group of items
RecentFilesRegistryHelper.cs Helper class to look up registry to get a list of recently used files
RootMenuRecentFiles.cs Custom menu
ToolControlRecentFiles.cs ToolControl implementation showing recent files in a dropdown list
ToolbarRecentFiles.cs Custom toolbar
Download the C# files
CommandRecentFiles.vb Command displaying the recent files in a dialog box in OnClick
FormRecentFiles.vb Form with a list box to select recent files to open
MultiItemRecentFiles.vb MultiItem command listing the recent files as a group of items
RecentFilesRegistryHelper.vb Helper class to look up registry to get a list of recently used files
RootMenuRecentFiles.vb Custom menu
ToolControlRecentFiles.vb ToolControl implementation showing recent files in a dropdown list
ToolbarRecentFiles.vb Custom toolbar
Download the VB.NET files

Download the files for all languages

See Also:

How to create dynamic menu commands (MultiItem)