Recently used files—Command, MultiItem, and ComboBox


PurposeThis sample shows how to implement different styles of custom commands—a normal button command, a MultiItem command, and a combo box—to customize ArcGIS for Desktop applications. All three types of commands perform the same functionality: listing and opening recently used documents. This sample also shows how to create a custom toolbar and menu with your custom command.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open and compile the sample project in Visual Studio. Set up a 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. You can also open a document in the Recent Files list with the drop-down list tool control. See the following screen shot:


  5. Screen shot of the Recent Files list

CommandRecentFiles.cs Command displaying the recent files in a dialog box in OnClick.
FormRecentFiles.cs Form with a list box of 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.
RecentFilesCombo.cs ComboBox implementation showing recent files in a drop-down 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 of 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.
RecentFilesCombo.vb ComboBox implementation showing recent files in a drop-down list.
ToolbarRecentFiles.vb Custom toolbar.
Download the VB.NET files

Download the files for all languages

See Also:

How to create dynamic menu commands using a MultiItem




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced