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);

解决方案 »

  1.   

    注释 lvc.cx = 100 试试
      

  2.   

    估计和 LVCFMT_SPLITBUTTON 有关。
      

  3.   

    这个代码是什么函数里面的? init?
      

  4.   

    在 WM_InitDialog  里面调用的
      

  5.   

    资源编辑的时候不是有预览吗,那个预览弹出的对话框上,LISTVIEW的列宽能否拖动呢?
      

  6.   

    版主:
        你问题得到解决了吗?什么做
    我的是这样        Col.mask = LVCF_FMT| LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;
    Col.fmt = LVCFMT_LEFT;
    Col.iSubItem = i;
                    Col.cx = 90;
    但有一个问题是有的列可以拖动,有的不行。无语,,,,
    请教高手,在线求解