Posted on 2007-04-02 14:41
宋鵬 閱讀(1121)
評(píng)論(0) 編輯 收藏 引用 所屬分類:
Evc Debug Code
BOOL CTest::OnInitDialog()
{
CDialog::OnInitDialog();
//動(dòng)態(tài)創(chuàng)建列表框
//----------------------------------------------------
#define IDC_LISTBOX 112 //列表框標(biāo)識(shí),放在頭文件中
CListBox *pList = new CListBox; //給列表框?qū)ο蠓峙鋬?nèi)存,在成員變量中定義
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
}