IDC_LIST1 是 win32 sdk 的公共控件 List Control , 为什么 ListCtrl 顶部的 header 标头 无法拖动改变列宽呢,代码如下
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST1); LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
lvc.fmt = LVCFMT_LEFT | LVCFMT_SPLITBUTTON;
lvc.cx = 100;
lvc.pszText = tx("消费记录ID");
ListView_InsertColumn(hwndList, 0, &lvc); lvc.pszText = tx("消费类型");
ListView_InsertColumn(hwndList, 1, &lvc); lvc.pszText = tx("消费金额");
ListView_InsertColumn(hwndList, 2, &lvc); lvc.pszText = tx("消费时间");
ListView_InsertColumn(hwndList, 3, &lvc); lvc.pszText = tx("附加信息");
ListView_InsertColumn(hwndList, 4, &lvc);
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST1); LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
lvc.fmt = LVCFMT_LEFT | LVCFMT_SPLITBUTTON;
lvc.cx = 100;
lvc.pszText = tx("消费记录ID");
ListView_InsertColumn(hwndList, 0, &lvc); lvc.pszText = tx("消费类型");
ListView_InsertColumn(hwndList, 1, &lvc); lvc.pszText = tx("消费金额");
ListView_InsertColumn(hwndList, 2, &lvc); lvc.pszText = tx("消费时间");
ListView_InsertColumn(hwndList, 3, &lvc); lvc.pszText = tx("附加信息");
ListView_InsertColumn(hwndList, 4, &lvc);
你问题得到解决了吗?什么做
我的是这样 Col.mask = LVCF_FMT| LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;
Col.fmt = LVCFMT_LEFT;
Col.iSubItem = i;
Col.cx = 90;
但有一个问题是有的列可以拖动,有的不行。无语,,,,
请教高手,在线求解