CListCtrl rect area goes whitish

Hello Experts,

I have rarely worked on MFCs and hence don't know much of it's internals and call flows. So my question may look naive to you guys.


I wanted Tabbing in my Dialog box and didn't wanted to use Property Sheet/pages, So I went for using Dialog boxes and tab controls together as mentioned in the project on below link

It basically has a class inherited from CTabCtrl and it switches between my different child dialog boxes (one per tab) on selection changes in the tabs.
So basically child dialog box get super imposed on the parent dialog's rectangle area.

On some of my dialog boxes I have CListCtrl controls.
Now I execute my program and just click on my CListCtrls and minimize my application.
When I again click on my application (basically restore the application's dialog) in the taskbar, Now I see my CListCtrl's rectangle area as whitish with nothing into it.

Again clicking all over the CListCtrl's rect area shows me all previous contents.

Can any one point what all wrong I am doing here and suggest a solution for this?



  • [color=Blue]For both the dialog and the tab control set the WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.

    If this will not do it, then your child/parent chains are not properly designed. Actually that code sample you quoted as an example - this code is not looking fine.

    The dialog is a parent of the tab control.
    The tab control is a parent of each modeless dialog.[/color]
  • Thanks a ton for your input.

    I will try your suggestion and will update the forum.

    Thanks again
  • Hey,

    I tried using WS_CLIPCHILDREN and WS_CLIPSIBLINGS and they are not working for me.

    It looks to me that your suspicion of incorrect child/parent chains is true.

    I am sure that my tab control is child of my main window (as I have put the tab control on my main window's layout and linked it with a member variable).

    Now what I need to make sure that those other modeless child windows should be a child of my tab control.

    Again as I am new, How can I do it programmatically?
    However, I have implemented a "void DoDataExchange(CDataExchange *pDX)" routine for my Tab Control class and there I did "DDX_Control" on all my child modeless windows.
    I am not sure whether doing above will make my modeless windows as child of TabControl or not.
    But yes my original issue of invisibility of CListCtrl on child modeless windows is still not solved after doing the above. :-(

    Any more suggestions?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!