I would like to know if it is possible to customize a CListBox to base it's
items on child dialog resources (like CPaneDialog does, or better, like
ListBox ItemDataTemplate in WPF).
I find custom draw or owner draw too painfull to implement, and hard to
extend and reuse.
Regards,
Louis-Pierre Beaumont
http://www.codeproject.com/KB/combobox/xlistbox.aspx
http://www.codersource.net/mfc_clistbox_owner_draw_picture.html
Could help get you started...
Tom
"Louis-Pierre Beaumont" <Louis-Pierre Beau...@discussions.microsoft.com>
wrote in message news:216F03AA-57FF-44F8...@microsoft.com...
That said, you can put child controls in a listbox; I've done it several times. It is a
bit tricky, and a bit painful, and a good deal more painful than owner-draw nearly all the
time.
The trick is partly in designating the listbox as a control parent (WS_EX_CONTROLPARENT),
and partly in how you handle the messages from the children. Alas, most of the code I
have that does this is proprietary and I can't give out samples. You have to do a lot of
SetWindowPos calls to handle the scrolling. But it is doable; I've put edit controls,
radio buttons, check boxes, and combo boxes into list boxes.
But I'm not sure a listbox is your best choice. Using a grid control might be a better
choice because these features are built into grid controls. So I'd look into a grid
control instead of trying to re-invent the technique (my technique was invented in the
late 1990s)
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
I wasn't exactly sure what OP was looking for ...
As you know, but for OPs benefit in case they are reading this post as well,
there are tons of articles on extending or adding controls to the CListCtrl,
for example:
http://www.codeproject.com/KB/list/Extended_List_Control.aspx
Tom
"Joseph M. Newcomer" <newc...@flounder.com> wrote in message
news:fll1f59vddimpeo2b...@4ax.com...
I already found the second one you gave me. For now, thats what im doing.
But i would really like an "easy way" to integrate dialogs into listboxes.
Thank you :)
That answers my question. Im going to use a grid instead of a Listbox as you
advised. I really don't want to handle repositioning + the repainting the
controls myself.
"Joseph M. Newcomer" wrote:
> .
>
That sample exactly doest what i want to do, it hosts a CDialog into a cell!
:)
Thank you for all this precious help!
"Tom Serface" wrote:
> .
>