Partilhar via


CFileDialog::SetControlText

Call this method to set the text for the specified control in an Explorer-style Open or Save As dialog box.

void SetControlText(
   int nID,
   LPCSTR lpsz 
);
void SetControlText(
   int nID,
   const wchar_t *lpsz 
);

Parameters

  • [in] nID
    The ID of the control for which to set the text.

  • [in] lpsz
    A pointer to the string that contains the text to set for the control.

Remarks

Both versions of this function are valid for applications that use Unicode. However, only the version with the LPCSTR type is valid for applications that use ANSI.

To use this method, you must create the dialog box with the OFN_EXPLORER style. Otherwise, the function will fail with an assertion.

Requirements

Header: afxdlgs.h

See Also

Reference

CFileDialog Class

Hierarchy Chart

CDM_SETCONTROLTEXT

CFileDialog::HideControl

Other Resources

CFileDialog Members