개발자/WPF(C#) UI
MFC 프로퍼티 컨트롤(추가예정)
영화같이
2020. 8. 11. 20:05
반응형
예제
다음 예제에서는 개체를 CMFCPropertyGridProperty 구성하는 방법을 보여 줍니다.
또한 이 예제에서는 CMFCPropertyGridProperty 클래스에서 다양한 메서드를 사용하여 옵션을 추가하고, 하위 항목을 추가하고, 속성을 활성화하고, 속성을 표시하는 방법을 보여 줍니다. 이 예제는 새 컨트롤 샘플의일부입니다.
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance"));
// construct a COleVariant object.
COleVariant var3DLook((short)VARIANT_FALSE, VT_BOOL);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D Look"), var3DLook,
_T("Specifies the dialog's font will be nonbold and controls will have a 3D border")));
CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Border"),
_T("Dialog Frame"), _T("One of: None, Thin, Resizable, or Dialog Frame"));
pProp->AddOption(_T("None"));
pProp->AddOption(_T("Thin"));
pProp->AddOption(_T("Resizable"));
pProp->AddOption(_T("Dialog Frame"));
pProp->AllowEdit(FALSE);
pGroup1->AddSubItem(pProp);
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Caption"), (COleVariant) _T("About NewControlsDemo"), _T("Specifies the text that will be displayed in the dialog's title bar")));
pGroup1->AdjustButtonRect();
pGroup1->AllowEdit();
pGroup1->Enable();
pGroup1->Show();
pGroup1->Redraw();
반응형