C++ 在listview中绘制3个图像和文本
我没有使用mfc 我为表中显示的数据创建自己的列表视图C++ 在listview中绘制3个图像和文本,c++,winapi,visual-c++,C++,Winapi,Visual C++,我没有使用mfc 我为表中显示的数据创建自己的列表视图 hListView = CreateWindowEx(0, WC_LISTVIEW, NULL, WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_EDITLABELS, 0, 0, h_rcl.right - h_rcl.left, h_rcl.bottom - h_rcl.top, hwnd_main, (HMENU)1000, hInstance, NULL); 但在其中一列中,我想显
hListView = CreateWindowEx(0, WC_LISTVIEW, NULL, WS_CHILD | WS_VISIBLE | LVS_REPORT |
LVS_EDITLABELS, 0, 0, h_rcl.right - h_rcl.left, h_rcl.bottom - h_rcl.top,
hwnd_main, (HMENU)1000, hInstance, NULL);
但在其中一列中,我想显示如下数据:
Text | Text of c,因为我想放一个img
所以我的桌子看起来像:
# | column1 | column 2
1 | "text <img> | text <img>" | text
您可以:
启用LVS_EX_SUBITEMIMAGES窗口样式,然后在与ListView关联的ImageList中指定每项每列图像索引
ListView项目
ListView_SetItemText(hListView, items_num, 1, "test");