![](/img/trans.png)
[英]How does the MFC PropertyGrid control work in the dialog editor in visual studio?
[英]How to connect an MFC control to a custom control in the visual dialog editor
我已經在MFC可視對話框設計器中創建了一個自定義控件,如下所示:
但是,我不確定如何將自定義控件(在這種情況下,我創建了一個從CWnd
繼承的類CGraphCtrl
)鏈接到在可視化編輯器中創建的區域,我假設我可以在以下情況下執行此操作我調用了CGraphCtrl::Create
,但是因為它使用const CRect&
作為參數,所以它將覆蓋指定的區域。 我在CStockManagerDlg::OnInit
調用CGraphCtrl::Create
,如下所示:
m_graphCtrl.Create( _T("STATIC"), _T("Graph Control"), WS_CHILD | WS_VISIBLE,
CRect( 0, 0, 100, 100 ), this, IDC_GRAPH );
您可以在可視對話框編輯器中創建一個CStatic控件。 然后右鍵單擊它並創建一個控件成員變量,如CStatic m_graphCtrl。 然后編輯該代碼,使其成為CGraphCtrl m_graphCtrl。 這會將您的代碼附加到原始CStatic。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.