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 用图表标题字体。但你还可以自毁内容。