|
|
|
Как добавить иконку в сабитем lsit-view
|
|||
|---|---|---|---|
|
#18+
Необходимо добавить иконку в list-view, вот код: ListView_SetExtendedListViewStyle(_hLV, LVS_EX_SUBITEMIMAGES); hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, 2, 1); if (hImageList == NULL) MessageBox(NULL, "ImageList_Create() failed", NULL, MB_OK); HICON hIcon = LoadIcon(HINST, MAKEINTRESOURCE(IDI_CHECKED)); iChecked = ImageList_AddIcon(hImageList, hIcon); if (iChecked == -1) MessageBox(NULL, "iChecked is -1", NULL, MB_OK); hIcon = LoadIcon(HINST, MAKEINTRESOURCE(IDI_UNCHECKED)); iUnchecked = ImageList_AddIcon(hImageList, hIcon); if (iUnchecked == -1) MessageBox(NULL, "iUnchecked is -1", NULL, MB_OK); if (ListView_SetImageList(_hLV, hImageList, LVSIL_SMALL) == NULL) MessageBox(NULL, "ListView_SetImageList failed", NULL, MB_OK); int itemCount = ListView_GetItemCount(_hLV); LVITEM LvItem; vector < unsigned short > CheckColumns; CheckColumns.push_back(5); if ( itemCount > 0 ) { for (unsigned short i = 0; i < CheckColumns.size(); ++i) { for (unsigned short j = 0; j < itemCount; ++j) { MessageBox(NULL, "11", NULL, MB_OK); LvItem.mask = LVIF_IMAGE; LvItem.iItem = j; LvItem.iSubItem = CheckColumns ; LvItem.iImage = iChecked; if (ListView_SetItem(_hLV, &LvItem) == FALSE) MessageBox(NULL, "Fals", NULL, MB_OK); } } } не работает, просто не появляються иконки и все. В чем может быть проблемма? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2006, 14:14 |
|
||
|
Как добавить иконку в сабитем lsit-view
|
|||
|---|---|---|---|
|
#18+
Eugene7Необходимо добавить иконку в list-view, вот код: не работает, просто не появляються иконки и все. В чем может быть проблемма? прежде чем присваивать иконку не мешало бы вставить строку по InsertItem(ItemIndex, ...), а потом в SetItem(ItemIndex) указать sub-картинку ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2006, 14:42 |
|
||
|
Как добавить иконку в сабитем lsit-view
|
|||
|---|---|---|---|
|
#18+
Cerebrum Eugene7Необходимо добавить иконку в list-view, вот код: не работает, просто не появляються иконки и все. В чем может быть проблемма? прежде чем присваивать иконку не мешало бы вставить строку по InsertItem(ItemIndex, ...), а потом в SetItem(ItemIndex) указать sub-картинку Строчки есть, две. И 9 сабитемов ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2006, 14:53 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=33707101&tid=2031373]: |
0ms |
get settings: |
6ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
186ms |
get topic data: |
6ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
1ms |
| others: | 228ms |
| total: | 472ms |

| 0 / 0 |
