能力值:
( LV2,RANK:10 )
|
-
-
2 楼
用listview试试
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
谢谢成功了。。。之前一直找不到这个
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
又出个问题 只可以给第一列添加项 第二列添加没反应怎么办啊
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
贴一下你的代码
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
ZWhwnd = CreateWindow ( WC_LISTVIEW,NULL,WS_VISIBLE | WS_CHILD | WS_BORDER |
LVS_REPORT | LVS_SHOWSELALWAYS,10,10,240,280,hwnd,( HMENU ) 1,( HINSTANCE ) GetWindowLong ( hwnd,GWL_HINSTANCE ),NULL );
SendMessageA ( ZWhwnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_GRIDLINES,-1 );
LVCOLUMN ColInfo1 = { 0 };
LVITEM p1 = { 0 };
ColInfo1.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT | LVS_REPORT;
ColInfo1.fmt = LVCFMT_CENTER;
ColInfo1.iSubItem = 0;
ColInfo1.cx = 80;
ColInfo1.pszText = L"目标地址";
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,0,( LPARAM ) &ColInfo1 );
ColInfo1.pszText = L"当前的值";
ColInfo1.iSubItem = 1;
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,1,( LPARAM ) &ColInfo1 );
ColInfo1.pszText = L"上次的值";
ColInfo1.iSubItem = 2;
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,2,( LPARAM ) &ColInfo1 );
p1.mask = LVIF_TEXT | LVIF_STATE;
p1.iItem = 0;
p1.iSubItem = 1;//当前值。。。死活无效
p1.state = INDEXTOSTATEIMAGEMASK ( 1 );
p1.pszText = L"00400000";
SendMessageA ( ZWhwnd,LVM_INSERTITEM,0,( LPARAM ) &p1 );
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
有木有办法解决啊大哥。。。
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
是不是显示样式要改,图标样式,列表样式之类的.
|
能力值:
( LV2,RANK:10 )
|
-
-
9 楼
ZWhwnd = CreateWindow ( WC_LISTVIEW,NULL,WS_VISIBLE | WS_CHILD | WS_BORDER |
LVS_REPORT | LVS_SHOWSELALWAYS,10,10,240,280,hwnd,( HMENU ) 1,( HINSTANCE ) GetWindowLong ( hwnd,GWL_HINSTANCE ),NULL );
SendMessageA ( ZWhwnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_GRIDLINES,-1 );
LVCOLUMN ColInfo1 = { 0 };
LVITEM p1 = { 0 };
ColInfo1.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT | LVS_REPORT;
ColInfo1.fmt = LVCFMT_CENTER;
ColInfo1.iSubItem = 0;
ColInfo1.cx = 80;
ColInfo1.pszText = L"目标地址";
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,0,( LPARAM ) &ColInfo1 );
ColInfo1.pszText = L"当前的值";
ColInfo1.iSubItem = 1;
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,1,( LPARAM ) &ColInfo1 );
ColInfo1.pszText = L"上次的值";
ColInfo1.iSubItem = 2;
SendMessageA ( ZWhwnd,LVM_INSERTCOLUMN,2,( LPARAM ) &ColInfo1 );
p1.mask = LVIF_TEXT | LVIF_STATE;
p1.iItem = 0;
p1.iSubItem = 0;//当前值。。。死活无效
p1.state = INDEXTOSTATEIMAGEMASK ( 1 );
p1.pszText = L"00400000";
SendMessageA ( ZWhwnd,LVM_INSERTITEM,0,( LPARAM ) &p1 );
第二列
p1.mask = LVIF_TEXT | LVIF_STATE;
p1.iSubItem = 1;
p1.state = INDEXTOSTATEIMAGEMASK ( 1 );
p1.pszText = L"00400001";
SendMessageA ( ZWhwnd,LVM_SETITEMTEXT,0,( LPARAM ) &p1 );
有点忙,老板巡查。。。。。。。。
|
能力值:
( LV2,RANK:10 )
|
-
-
10 楼
好神奇啊谢谢大哥 。。。。。。。这是为什么呢
|
能力值:
( LV2,RANK:10 )
|
-
-
11 楼
第一列
p1.iSubItem = 0;//当前值。。。死活无效
这个地方是0 你写成 1
第二列
SendMessageA ( ZWhwnd,LVM_SETITEMTEXT,0,( LPARAM ) &p1 );
LVM_SETITEMTEXT 这个地方很多新手都是复制粘贴成LVM_INSERTITEM
|