A dialog window usually serves as the parent and owner of an entry field. The dialog window often includes a button that indicates whether the user wants to carry out an operation. When the user selects the button, the application queries the contents of the entry field and proceeds with the operation.

The definition of an entry field in an application's resource-definition file sets the initial text, window identifier, size, position, and style of the entry field. The following example shows how to define an entry field as part of a dialog template:

    DLGTEMPLATE IDD_SAMPLE
    BEGIN
        DIALOG "Sample Dialog", ID_DLG, 7, 7, 253, 145, FS_DLGBORDER,0
        BEGIN
            DEFPUSHBUTTON "~OK", DID_OK, 8, 151, 50, 23, WS_GROUP
            ENTRYFIELD "Here is some text", ID_ENTFLD, 42, 46, 68, 15,
                ES_MARGIN | ES_AUTOSCROLL
        END
    END


[Back] [Next]