次の方法で共有


QueryNewFile Event

Occurs when the New button is pressed in the Project Manager, just before a file is added to a project.

PROCEDURE Object.QueryNewFile
LPARAMETERS cFileType

Parameters

  • cFileType
    Specifies the file type selected in Project Manager when the New button was pressed. These values are the same as the File object Type property.

    QueryNewFile event is also supported on database container items, a special case, by the following cFileType values.

    Value FoxPro.H Constant File type Extension
    d FILETYPE_DATABASE Database .dbc
    D FILETYPE_FREETABLE Free table .dbf
    Q FILETYPE_QUERY Query .qpr
    K FILETYPE_FORM Form .scx
    R FILETYPE_REPORT Report .frx
    B FILETYPE_LABEL Label .lbx
    V FILETYPE_CLASSLIB Visual class Library .vcx
    P FILETYPE_PROGRAM Program .prg
    M FILETYPE_MENU Menu .mnx
    T FILETYPE_TEXT Text file varies

    The following table describes cFileType values for items specific to the DBC container. Except for the DBC table, which adds a table to the project, these items affect only the DBC.

    Value DBC Type Extension
    p Stored Procedure  
    t DBC table .dbf
    c Connection  
    r Remote View  
    l Local View  

Remarks

Addition of Visual FoxPro libraries (.FLL files) and applications (.APP files) do not call the QueryNewFile event.

Since this event does not directly add files to the project, if you wish to add other files when QueryNewFile is called, you should do this explicitly with your own code, using the Project Objects File Collection Add. For example, you could do this if you wanted the QueryNewFile event to call a Wizard, which you created, when adding a new file of a specific type.

Example

     _VFP.ActiveProject.Files.Add(mynewfile)

See Also

File Object | Type | Project Object | QueryAddFile Event | QueryModifyFile Event | QueryRemoveFile Event | QueryRunFile Event