Hi,
I have a CListCtrl with 2 columns. Right now the CListCtrl expands and shrinks as the dialog is resized, however the columns do not resize, what i am trying to do is to divide the width of the CListCtrl equally among the 2 columns. I have tried using SetColumnWidth without much luck, heres the code:
how can this be done?Code:CRect rect; int newWidth; if(m_pList->GetSafeHwnd()) { m_pList->GetWindowRect(rect); ScreenToClient(rect); newWidth = (rect.right-rect.left)/2; rect.right = rect.left + cx - 20; m_pList->SetColumnWidth(0,newWidth); m_pList->SetColumnWidth(1,newWidth); m_pList->MoveWindow(rect); }
Thanks




Reply With Quote