开发者

How to retrieve data from a ListControl(ListView)?

开发者_运维问答

I have a listcontrol with three columns. I want to read what text is in the third column. I need this, because i want color this column according to that what text is in it. Can anyone tell me, how to read the data?

Thanks in advance!

kampi


If your control's associated CListCtrl is called m_listCtrl simply use:

CString colText = m_listCtrl.GetItemText(item, subitem);

You associate that variable with the control itself via something like this:

void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_LIST1, m_listCtrl);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜