Partager via


Using IntelliSense in Visual FoxPro

IntelliSense functionality is activated as you type in the Visual FoxPro Editor, in code editor windows for methods, in the Command window, and in the Watch window when debugging code.

To display IntelliSense drop-down lists and dialog boxes

  • Enter Visual FoxPro or user-defined keywords in an editor.

    Keywords in this case are syntax elements in Visual FoxPro commands, functions, and class definitions; ActiveX control methods and events; COM servers; and user-defined keywords. When you use the AS clause in code, IntelliSense displays a drop-down list of available types, including types from the following sources:

    • Visual FoxPro object base classes
    • Visual FoxPro data types

    The following items will be listed if you add them in the IntelliSense Manager:

    • Registered type libraries
    • User-defined types and enumerated values and custom classes

    To implement IntelliSense for Visual FoxPro and COM classes in code (.prg) files, you must employ strong typing. Internally, for objects created at run time by commands such as CREATEOBJECT( ), CREATEOBJECTEX( ), NEWOBJECT( ), and GETOBJECT( ), Visual FoxPro creates an instance of a temporary memory object to provide the Properties, Methods and Events list. IntelliSense creates a drop-down list from those available in the class definition or type library, which it seeks in the following locations:

    • Visual FoxPro object base classes
    • Class definitions in memory, in the order in which they were loaded
    • Class definitions in the current program
    • Class definition in the class library (.vcx) file opened by the SET CLASS command
    • Class definitions in the procedure files opened by the SET PROCEDURE command
    • Class definitions in the Visual FoxPro program execution chain (for more information, see DO Command)
    • The system registration database (the Registry)
    • Keyboard shortcuts for Quick Info and List Members
  • Type an activator key in a code statement.

    Activator keys (which are determined by the type of the item in the FoxCode.dbf) are " " (space), "." (period), "(" (left or open parenthesis), and "=" (equals sign). In addition to the activator keys, IntelliSense responds to navigator and termination keys. Alphanumeric keys sequentially select from the available list, and arrow and page keys respectively pan and scroll through available list members.

Keyboard Shortcuts

You can use the Shortcut menu options, or, in the appropriate position in an editor window, you can use the following shortcut keys to engage IntelliSense features:

Shortcut keys IntelliSense feature
CTRL+I Quick Info
CTRL+J List Member, List Values

IntelliSense Options

You can modify or restore the default IntelliSense Auto List and Auto Quick Info settings in the Visual FoxPro IntelliSense Manager Window. The contents of the Auto List Values drop-down list are determined by the type library of the referenced object.

The most detailed way of affecting the functionality of IntelliSense for native commands and functions is to change the contents of the FoxCode.dbf table. Object properties, methods, and events are not affected by the FoxCode.dbf table.

You can enable or disable IntelliSense functionality programmatically by setting the _VFP.EditorOptions property value. For more information, see EditorOptions Property.

You can set the font and color scheme for the drop-down list in the Windows Display Control panel. You can set the maximum number of items displayed in the drop-down list through the List display count check box in the Editor tab of the Tools menu Options dialog box.

You can access the references stored in the FoxCode.dbf at design time from the IntelliSense Manager and using the _FOXCODE system variable as in the following example:

USE (_FOXCODE) SHARED

See Also

IntelliSense Overview | IntelliSense Activator, Navigation, and Terminator Keys | Auto Table/Field/Variable Names | Auto MRU (Most Recently Used) Files | IntelliSense Support in Visual FoxPro | Customizing IntelliSense Using FoxCode | FoxCode Object | EditorOptions Property | _FOXCODE System Variable