MFC listctrl怎么不显示图标?
代码如下,图标的ID为IDI_ICON1到8,m_imagelist为对话框类的成员变量HICONhIcon[8];intn;m_imagelist.Create(16,...
代码如下,图标的ID为IDI_ICON1到8,m_imagelist为对话框类的成员变量
HICON hIcon[8];
int n;
m_imagelist.Create(16, 16, 0, 8, 8);
for(int i=0; i<8; i++)
hIcon[i] = AfxGetApp()->LoadIcon(IDI_ICON1+i);
for (n = 0; n < 8; n++) {
m_imagelist.Add(hIcon[n]);
}
static char* color[] = {"white", "black", "red",
"blue", "yellow", "cyan",
"purple", "green"};
CListCtrl* pList =
(CListCtrl*) GetDlgItem(IDC_LIST1);
pList->SetImageList(&m_imagelist, LVSIL_SMALL);
for (n = 0; n < 8; n++) {
pList->InsertItem(n, color[n], n);
}
已经选定是Icon了,但是还是没用。。。 展开
HICON hIcon[8];
int n;
m_imagelist.Create(16, 16, 0, 8, 8);
for(int i=0; i<8; i++)
hIcon[i] = AfxGetApp()->LoadIcon(IDI_ICON1+i);
for (n = 0; n < 8; n++) {
m_imagelist.Add(hIcon[n]);
}
static char* color[] = {"white", "black", "red",
"blue", "yellow", "cyan",
"purple", "green"};
CListCtrl* pList =
(CListCtrl*) GetDlgItem(IDC_LIST1);
pList->SetImageList(&m_imagelist, LVSIL_SMALL);
for (n = 0; n < 8; n++) {
pList->InsertItem(n, color[n], n);
}
已经选定是Icon了,但是还是没用。。。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询