如何使用LVITEM在CListCtrl中添加具有中心对齐的图像

时间:2017-04-07 12:54:51

标签: image visual-c++ mfc clistctrl

我正在尝试为CListCtrl中的第二列设置中心对齐,其中包含内容中的图像。怎么做?

    m_MyListCtrl.InsertColumn(0, L"No.", LVCFMT_LEFT, 75);
    m_MyListCtrl.InsertColumn(1, L"Result", LVCFMT_LEFT, 75); // this column has image which needs to be center aligned
    m_MyListCtrl.InsertColumn(2, L"values", LVCFMT_LEFT, 75);
    m_MyListCtrl.InsertColumn(3, L"description", LVCFMT_LEFT, 75);


    //Adding a image from the image list like below
    lvi.iItem = nListItem;
    lvi.iSubItem = nSubItem;
    lvi.iImage = 2;//(takes image from the image list loaded)

0 个答案:

没有答案