MFC中的列表框控件 [英] listbox control in mfc

查看:299
本文介绍了MFC中的列表框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mfc

推荐答案

BOOL CGetFileListDlg::OnInitDialog()
{  
CDialog::OnInitDialog();

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);         // Set big icon
SetIcon(m_hIcon, FALSE);        // Set small icon

// TODO: Add extra initialization here

LVITEM lvItem;
LVCOLUMN lvColumn;
int nCol;

lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_CENTER;
lvColumn.cx = 10;
lvColumn.pszText = _T("Filename");
ListView_InsertColumn( m_List, 0, &lvColumn ); 
ListView_SetItemText( m_List, 0, 0, _T("TEST") );

return TRUE;  // return TRUE  unless you set the focus to a control    
}


这篇关于MFC中的列表框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆