Field Info


It is possible to add commands to the table window context menus in ArcMap. When a user chooses a command from a table window context menu, you can find information about the table window at the time the command is invoked. This includes the table shown in the table window and the field that is active.

When the command in this sample is executed, a dialog of information about the active field in the active table window is displayed. The command will be enabled if it is added to any of the table window context menus. However, the table column context menu is the most appropriate since invoking this context menu also sets the active field.

The information displayed depends on the type of field. For example, the dialog displays geometry information for a geometry field and information such as the field precision and width for a numeric field.

How to use:
  1. Start ArcMap, and display the Customize Dialog.
  2. In the Customize dialog, click on Add from file and select this sample's dll.
  3. In the Customize dialog, Toolbars tab, check Context Menus. In the Context Menus toolbar that comes up, navigate to Context Menus; Table column context menu, and open it.
  4. Under the Commands tab of the Customize dialog, select the Field Info command from the 'Developer Samples' category and drag it onto the Table column context menu. Close the Customize dialog.
  5. If necessary, add a layer or table to ArcMap.
  6. Right-click a table or layer in the table of contents and choose either the open or open attribute table command. This opens the table window.
  7. Right-click a column in the table window and choose the Field Info command.


Difficulty: Beginner

Visual Basic
File Description
clsFieldInfo.cls Implementation of ArcMap command to display field info.
frmFieldInfo.frm The dialog that displays the field info.
prjFieldInfo.vbp VB project file for sample.
FieldInfo.dll Compiled project DLL.

Key CoClasses: TableView
Key Interfaces: IMxDocument, ITableControlInfo, ITableFields, IFieldInfo, IField, ITable, IGeometryDef