簡體   English   中英

MFC PropertyGrid不會在用戶單擊時擴展(禁用)

[英]MFC PropertyGrid will not expand on user click (disabled)

我實際上正在使用MFC屬性網格,並且希望允許用戶擴展“項目”。

基本上我是將項目添加到MFC屬性網格

CMFCPropertyGridProperty* mParent = new CMFCPropertyGridProperty(_T("cycle"));
mGrid.AddProperty(mParent);
mParent->AddSubItem(new CMFCPropertyGridProperty(_T("Id"),        _T("test")));
mParent->AddSubItem(new CMFCPropertyGridProperty(_T("Name"),      _T("test")));
mParent->AddSubItem(new CMFCPropertyGridProperty(_T("DateStart"), _T("test")));
mParent->AddSubItem(new CMFCPropertyGridProperty(_T("DateStop"),  _T("test")));

基本上,我希望所有項目在添加時都不會展開,但我希望用戶能夠展開它們。但是,似乎默認行為是阻止用戶展開項目...

到目前為止,我已經嘗試過Enable(true)EnableActiveAccessibility()但是它們似乎不起作用...

知道應該設置哪個屬性?

謝謝!

這不是很明顯,但是您需要使用bExpand參數為FALSE來調用CMFCPropertyGridProperty :: Expand

參數[in] bExpand TRUE,以擴展屬性; FALSE會使財產倒塌。 默認值是true。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM