Custom List View
Posted on 2006-04-15
Dear Experts Exchange,
I try to build my own list view. I'd like each row to be the following :
| B1 | | B2 | Text
B1 and B2 being (for now) CButtons.
My actual code is organised this way :
- a "CRow : public CView" Object describing a line (contains 2 buttons instances, one for B1 and one for B2 + a custom drawing fuction drawing the text)
- a "CMyList" : public CView" Object describing the list itself. This object makes for now only 2 instances of CRow (that's a preliminary test class).
CMyList is registered as a Custom MFC Object, declared in the resource file as a child view for a CDialogBar.
My main problem is a Focus Problem I think : only the first row instance tracks both buttons clicks. Trying things such as SetFocus() for the second line does not seem to work, as the only messages tracking view is still the first row.
A subsidiary question : Is it possible to call only the drawing function of a CButton in the OnPaint function of a custom object ?