开发者

How to retrieve data from a ListControl(ListView)?

开发者 https://www.devze.com 2022-12-21 00:52 出处:网络
开发者_运维问答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
开发者_运维问答

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

精彩评论

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

关注公众号