Posted on 2007-04-02 14:41
宋鵬 閱讀(1117)
評論(0) 編輯 收藏 引用 所屬分類:
Evc Debug Code
BOOL CTest::OnInitDialog()
{
CDialog::OnInitDialog();
//動態創建列表框
//----------------------------------------------------
#define IDC_LISTBOX 112 //列表框標識,放在頭文件中
CListBox *pList = new CListBox; //給列表框對象分配內存,在成員變量中定義
pList->Create(WS_CHILD
|WS_VISIBLE
|WS_VSCROLL
|WS_HSCROLL
|WS_TABSTOP,
CRect(10,10,100,150),
this,
IDC_LISTBOX);
delete CListBox; //用完之后刪除
//-----------------------------------------------------
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}