Howdy, Stranger!

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

Categories

CListCtrl rect area goes whitish

dkg0414dkg0414 Member Posts: 3
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.

Problem:

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

http://simplesamples.info/MFC/CTabCtrl.php

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?

Regards
Deepak

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [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]
  • dkg0414dkg0414 Member Posts: 3
    Thanks a ton for your input.

    I will try your suggestion and will update the forum.

    Thanks again
    Deepak
  • dkg0414dkg0414 Member Posts: 3
    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?

    Regards
    Deepak
Sign In or Register to comment.