Posted on 2007-04-02 14:41
宋鹏 阅读(1108)
评论(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
}