Using List-View Controls

Using List-View Controls

创建

首先,使用List-View必须 读取DLL用InitCommonControls.

然后CreateWindowEx用WC_LISTVIEW.

create代码

//Init
RECT rcl;
INITCOMMONCONTROLSEX icex;

// Ensure that the common control DLL is loaded.
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC
= ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(
&icex);

//Create
GetClientRect(hwndParent, &rcl);
HWND hWndListView
= CreateWindow(WC_LISTVIEW,
L
"",
WS_CHILD
| LVS_REPORT | LVS_EDITLABELS,
0,
0,
rcl.right
- rcl.left,
rcl.bottom
- rcl.top,
hwndParent,
(HMENU)ID_LISTVIEW,
g_hInst,
NULL);

return (hWndListView);

字体

在插入项之前,发送WM_SETFONT来设置字体。

默认 list view 用图表标题字体。但你还可以自毁内容。

posted on 2011-03-17 22:48  oleeceo  阅读(175)  评论(0)    收藏  举报

导航