16,472
社区成员
发帖
与我相关
我的任务
分享
CString str, str2;
for(int i=0; i<m_listbox.GetCount(); i++)
{
m_listbox.GetText(i, str2);
str += str2 + _T("\r\n");
}
AfxMessageBox(str);
CListBox *lb;
lb=NULL;
CView *pView;
pView=((CMainFrame*)AfxGetMainWnd())->GetActiveView();
pView->lb=(CListBox *)GetDlgItem(listbox的ID);
void CXXXDlg::OnButton1()
{
::PostMessage(pView->m_hWnd,WM_PAINT,0,0);
}
void CXXView::OnDraw(CDC *pDC)
{
if(lb)
{
//lb就是那个列表框,你取数据出来显示就就可以了
}
}