You can run the Class Browser from the Visual FoxPro menu or from the Command window.
To run the Class Browser
– Or –
Use the DO command and the _BROWSER system variable:
DO (_BROWSER)
The program stored by default to the _BROWSER system memory is Browser.app. Browser.app accepts five optional arguments:
DO (_BROWSER) [WITH [tcFileName][, tcDefaultClass[.member]][, tlListBox][, tcClassType][, tnWindowState]]
Argument | Description |
cFileName | The name of the .vcx, .scx, .olb, .tlb, .pjx, or .exe file to open in the Class Browser. |
cDefaultClass[.member] | The class in the .vcx to be selected by default. If no default class is specified, the class library is selected. If a member is specified, that member is selected in the Members list. |
lListBox | Specifies whether to display the classes and members in list boxes rather than treeview controls. Include true (.T.) for this parameter to display the list boxes. The default is false (.F.) |
cClassType | Specifies the initial Type filter for the classes displayed in the Class Browser. You can change the filter in the Class Browser by choosing another value from the Type list. The default is no filter. |
nWindowState | 0 - Normal (the default) 1 - Minimized 2 – Maximized |
lGallery | Default: .F. Specifies whether to open in the Component Gallery instead of the Class Browser. Use true (.T.) to open in the Component Gallery. |
For example, the following command opens the Class Browser maximized with the print_report class in Samples.vcx selected, the cmdOK object selected in the Members list, and the forms and members in Samples.vcx displayed in list boxes:
DO (_BROWSER) WITH "samples.vcx", "print_report.cmdOK", .T., "form", 2
To specify a default class and member name to open with the Class Browser
DO (_BROWSER) WITH “mylib”,”myclass.cMessage”
You can also use the Class Browser to specify the default file to open when you start the Class Browser from the Tools menu or the Command window.
To specify a default library to open with the Class Browser
_oBrowser.SetDefaultFile
This resets any previously specified default libraries.
You can add files to the default library opened by Class Browser.
To specify additional libraries to open with the Class Browser
_oBrowser.SetDefaultFile(.T.)
To remove libraries from the Class Browser list
_oBrowser.ResetDefaultFile
To remove all libraries from the Class Browser list
_oBrowser.ResetDefaultFile(.T.)