使CListctrl控制元件的列寬度固定:void CPList::OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult){LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);// TODO: Add your control notification handler code hereNMHEADER *pHdr = (NMHEADER*)pNMHDR;CHeaderCtrl *pHead = GetHeaderCtrl();pHdr->pitem->mask |= HDI_WIDTH;switch(pHdr->iItem) {case 0://第一列pHdr->pitem->cxy = 33;break;case 1://第二列pHdr->pitem->cxy = 250;break;case 2://第三列pHdr->pitem->cxy = 145;break;}*pResult = 0;}
使CListctrl控制元件的列寬度固定:void CPList::OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult){LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);// TODO: Add your control notification handler code hereNMHEADER *pHdr = (NMHEADER*)pNMHDR;CHeaderCtrl *pHead = GetHeaderCtrl();pHdr->pitem->mask |= HDI_WIDTH;switch(pHdr->iItem) {case 0://第一列pHdr->pitem->cxy = 33;break;case 1://第二列pHdr->pitem->cxy = 250;break;case 2://第三列pHdr->pitem->cxy = 145;break;}*pResult = 0;}