// JP opened flex table

Click to See Complete Forum and Search --> : Owner drawn CListCtrl & DrawItem


Ronan
June 17th, 1998, 06:35 PM
I have followed the sample on creating an ownerdrawn CListCtrl but DrawItem is never called, lots of people on usenet have the same problem, any Ideas?

junlin xu
June 24th, 1998, 06:28 PM
You should set the owner drawn style in dialog template or do the following:


void CEPListControl::OnPaint()

{

// change style here because PreCreateWindow() is not called

static BOOL bFirstTime = TRUE;

if(bFirstTime)

{

LONG dwStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);

dwStyle &= ~LVS_TYPEMASK;

dwStyle |= LVS_SHOWSELALWAYS | LVS_REPORT | LVS_OWNERDRAWFIXED;

::SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);

}


// ... the original stuff

}

Jean-Marie Carl
June 25th, 1998, 02:38 PM
Hi,


It depends on your program architecture. When you use a Doc/View model - try to get the message in the MDI part and not the VIEW part (and set the owner-draw style flag as mentioned in the other reply).


If this doesn't work, I can send you an example.


Hope this helps,

Greetings,

JMC

//JP added flex table