CMFCPropertyGridFileProperty Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCPropertyGridFileProperty Class.

The CMFCPropertyGridFileProperty class supports a property list control item that opens a file selection dialog box.

class CMFCPropertyGridFileProperty : public CMFCPropertyGridProperty  

Public Constructors

NameDescription
CMFCPropertyGridFileProperty::CMFCPropertyGridFilePropertyConstructs a CMFCPropertyGridFileProperty object.
CMFCPropertyGridFileProperty::~CMFCPropertyGridFilePropertyDestructor.

Public Methods

NameDescription
CMFCPropertyGridFileProperty::GetThisClassUsed by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.
CMFCPropertyGridFileProperty::OnClickButton(Overrides CMFCPropertyGridProperty::OnClickButton.)

Remarks

CObject

CMFCPropertyGridProperty

CMFCPropertyGridFileProperty

Header: afxpropertygridctrl.h

Constructs a CMFCPropertyGridFileProperty object.

CMFCPropertyGridFileProperty(
    const CString& strName,  
    BOOL bOpenFileDialog,  
    const CString& strFileName,  
    LPCTSTR lpszDefExt=NULL,  
    DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,  
    LPCTSTR lpszFilter=NULL,  
    LPCTSTR lpszDescr=NULL,  
    DWORD_PTR dwData=0);

Parameters

[in] strName
The property name.

[in] bOpenFileDialog
TRUE to open an Open File dialog box; FALSE to open a Save File dialog box.

[in] strFileName
The initial file name.

[in] lpszDefExt
A string of one or more file name extensions. The default value is NULL.

[in] dwFlags
Dialog box flags. The default value is a bitwise combination (OR) of OFN_HIDEREADONLY and OFN_OVERWRITEPROMPT.

[in] lpszFilter
A string of one or more file filters. The default value is NULL.

[in] lpszDescr
The property item description. The default value is NULL.

[in] dwData
Application-specific data that is associated with the property item. For example, a 32-bit integer or a pointer to other data. The default value is 0.

Return Value

Remarks

For a full list of available flags, see OPENFILENAME structure.

Example

The following example demonstrates how to create an object using the constructor of the CMFCPropertyGridFileProperty class. This example is part of the Visual Studio Demo sample.

	// CMFCPropertyGridProperty* pGroup3
	static TCHAR BASED_CODE szFilter[] = _T("Icon Files(*.ico)|*.ico|All Files(*.*)|*.*||");
	pGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Icon"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Specifies the dialog icon")));

Hierarchy Chart
Classes
CMFCPropertyGridCtrl Class
CMFCPropertyGridProperty Class

Show: