CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    894

    Strange visual glitch in PropertySheet pages?

    Hi everyone:


    I've encountered a strange visual glitch when I attempt to enlarge a window with a property sheet in it. Somehow a white space appears at the bottom. Can anyone suggest what that is? (Screen shot attached)

    I am using MFC, CPropertySheet and CPropertyPage classes. This property page is a modeless child window of the dialog.

    Thank you.
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2005
    Posts
    767

    Re: Strange visual glitch in PropertySheet pages?

    I am not very sure what the problem may be since I use Windows 2000 SP4. However as far my guess goes the History property page height is less than that of Favorites property page.
    Last edited by MrBeans; May 5th, 2006 at 05:15 AM.

  3. #3
    Join Date
    Aug 2001
    Posts
    507

    Re: Strange visual glitch in PropertySheet pages?

    Try using the CPropoerty PageEx class.

    U are getting this problem because the default sizes are different !!!

    Simple solution -> on the Redraw message, do GetDlgItem in a loop, and for ever item do Item->MoveWindow(pos). this way ur form will always be dynamic and will always keep the same aspect ratios as u want ..
    If you found my reply to be useful, please dont hesitate to rate it.


    DO NOT kick the Axe if it doesnt fall on your foot.

    Salman

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    894

    Re: Strange visual glitch in PropertySheet pages?

    Quote Originally Posted by salman108
    U are getting this problem because the default sizes are different !!!
    What do you mean? How can I change this default size?

    I did some research and it looks like the problem is in XP's Themes. I did not mention but this dialog is resizable and I am using GetDlgItem and MoveWindow to resize all controls inside.

    I know it looks like that white margin is actually unresized window, but it is not. (I checked it with WinID.) The dialog inside tab control is actually stretching all the way down. This is simply a visual theme. If you remove manifest from the file the problem goes away.

    I never dealt with those themes. If you look at the screenshot the size of "drawn" part of the page is actually 600 pixels. Strange. Almost like a default value for something. I also tried creating another tall static property sheet and the same visual glitch happens there.

    Does anyone have a suggestion how to fix it now?

  5. #5
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    894

    Re: Strange visual glitch in PropertySheet pages?

    Guys, what am I saying, look for yourself. Here's a simple MFC code to demonstrate...
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Strange visual glitch in PropertySheet pages?

    Yes, that's a known issue with the visual themes of Windows XP.
    The problem is that the standard theme for a property page contains some kind of gradient texture. This gradient texture has a fixed size and when you property page is bigger than this fixed gradient texture size, the gradient texture will be tiled and that's what you're seeing.

    I have no idea how to solve this.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  7. #7
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    894

    Re: Strange visual glitch in PropertySheet pages?

    Well, that "known issue" was a real pain in the ***. I spent two days on something that should 've taken two hours, but.... I was able to find a solution. Check attached sample & code.

    In a nutshell, I disabled themes and processed OnCtlColor for each page. Before that I prepared a brush that is a screenshot of a tab control's background, which for some reason doesn't have this size limitation. As you can see, it works (in case someone else stumbles upon it too).

    I should add one thing though. This method works for a static property sheet (that is nonresizable). If it is resizable one should make a really large background brush the size of a desktop window. It could be done by first enlarging a tab control to a size of a maximized window.

    And one last thing. To make this code operational on machines prior to Windows XP one should compile it without static linking to "UxTheme.lib" by loading the "UxTheme.dll" dynamically.

    Hope this helps. I'm glad I'm through with it.

    Cheers...
    Attached Files Attached Files

  8. #8
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Strange visual glitch in PropertySheet pages?

    That's an interesting solution. Thanks for sharing it
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  9. #9
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Strange visual glitch in PropertySheet pages?

    dc_2000, Why don't you writeup an article ? It could prove useful..

  10. #10

    Re: Strange visual glitch in PropertySheet pages?

    i have the same problem
    but your code examples making me (compiled with vs2005) absolutely diffrent output - all ok for first one, all background black for second one

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured