Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: i hope this question can be asked here Pin
Christian Graus31-Jan-07 22:48
protectorChristian Graus31-Jan-07 22:48 
QuestionList control width problem in MFC Pin
pandyapunita31-Jan-07 20:35
pandyapunita31-Jan-07 20:35 
AnswerRe: List control width problem in MFC Pin
Naveen31-Jan-07 21:02
Naveen31-Jan-07 21:02 
GeneralRe: List control width problem in MFC Pin
pandyapunita31-Jan-07 22:38
pandyapunita31-Jan-07 22:38 
GeneralRe: List control width problem in MFC Pin
pandyapunita1-Feb-07 2:54
pandyapunita1-Feb-07 2:54 
GeneralRe: List control width problem in MFC Pin
Naveen1-Feb-07 16:20
Naveen1-Feb-07 16:20 
GeneralRe: List control width problem in MFC Pin
pandyapunita1-Feb-07 18:28
pandyapunita1-Feb-07 18:28 
GeneralRe: List control width problem in MFC Pin
Naveen1-Feb-07 19:06
Naveen1-Feb-07 19:06 
try the code below


void ListCtrlEx::OnCustomDraw( NMHDR* pNMHDR_i, LRESULT* pResult_i )<br />
{<br />
    NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR_i );<br />
    NMCUSTOMDRAW   &nmcd = pLVCD->nmcd;<br />
    *pResult_i = CDRF_DODEFAULT;<br />
    switch (nmcd.dwDrawStage)<br />
    {<br />
    case CDDS_PREPAINT:<br />
      // We want item prepaint notifications, so...<br />
      *pResult_i = CDRF_NOTIFYITEMDRAW;<br />
      break;<br />
<br />
    case CDDS_ITEMPREPAINT:<br />
     {<br />
         // Want to merge a column in 3 rd row<br />
         if( nmcd.dwItemSpec == 3 )<br />
         {<br />
               LVCOLUMN stColumn = {0};<br />
               stColumn.mask = LVCF_WIDTH | LVCF_FMT;<br />
               for ( int nCol=0; GetColumn( nCol, &stColumn ); ++nCol )<br />
               {<br />
                   CRect ColumnRect;<br />
                   GetSubItemRect( nmcd.dwItemSpec , nCol, LVIR_LABEL, ColumnRect );<br />
                   // Merge 2 and 3 rd column so<br />
                   CRect ColumnRect2;<br />
                   CString csText = "some text";<br />
                   if( nCol == 2 )<br />
                   {<br />
                       GetSubItemRect( nmcd.dwItemSpec , ++nCol, LVIR_LABEL, ColumnRect2 );<br />
                       ColumnRect.right = ColumnRect2.right;<br />
                       csText = "merged text";<br />
                   }<br />
                   CDC *pdc = CDC::FromHandle( nmcd.hdc );                   <br />
                   pdc->DrawText( csText, ColumnRect, DT_SINGLELINE|DT_LEFT|DT_VCENTER );<br />
               }<br />
               *pResult_i = CDRF_SKIPDEFAULT;<br />
               return;<br />
         }        <br />
      *pResult_i = CDRF_DODEFAULT;<br />
      break;<br />
    }<br />
    default:<br />
      *pResult_i = CDRF_DODEFAULT;<br />
      break;<br />
    }<br />
}




nave

GeneralRe: List control width problem in MFC Pin
pandyapunita2-Feb-07 0:10
pandyapunita2-Feb-07 0:10 
GeneralRe: List control width problem in MFC Pin
Naveen2-Feb-07 0:39
Naveen2-Feb-07 0:39 
GeneralRe: List control width problem in MFC Pin
pandyapunita2-Feb-07 1:11
pandyapunita2-Feb-07 1:11 
GeneralRe: List control width problem in MFC Pin
Naveen2-Feb-07 1:13
Naveen2-Feb-07 1:13 
Questionlanguages Pin
zlatane31-Jan-07 20:20
zlatane31-Jan-07 20:20 
AnswerRe: languages Pin
Hamid_RT31-Jan-07 20:28
Hamid_RT31-Jan-07 20:28 
QuestionCan't find GetExtendedTcpTable function in iphlpapi.h! Pin
snake77731-Jan-07 19:43
snake77731-Jan-07 19:43 
AnswerRe: Can't find GetExtendedTcpTable function in iphlpapi.h! Pin
Hamid_RT31-Jan-07 20:03
Hamid_RT31-Jan-07 20:03 
AnswerRe: Can't find GetExtendedTcpTable function in iphlpapi.h! Pin
Hamid_RT31-Jan-07 20:15
Hamid_RT31-Jan-07 20:15 
GeneralRe: Can't find GetExtendedTcpTable function in iphlpapi.h! Pin
snake77731-Jan-07 20:39
snake77731-Jan-07 20:39 
GeneralRe: Can't find GetExtendedTcpTable function in iphlpapi.h! Pin
Hamid_RT31-Jan-07 21:10
Hamid_RT31-Jan-07 21:10 
QuestionNo Subject Pin
snake77731-Jan-07 19:32
snake77731-Jan-07 19:32 
Generaltitle please ! (and message) Pin
toxcct31-Jan-07 21:46
toxcct31-Jan-07 21:46 
QuestionMacro Preprocessing Pin
abhi_code31-Jan-07 19:14
abhi_code31-Jan-07 19:14 
AnswerRe: Macro Preprocessing Pin
Stephen Hewitt31-Jan-07 19:51
Stephen Hewitt31-Jan-07 19:51 
GeneralRe: Macro Preprocessing Pin
abhi_code16-Feb-07 5:18
abhi_code16-Feb-07 5:18 
QuestionCMap problem Pin
~Worried!31-Jan-07 18:59
~Worried!31-Jan-07 18:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.