none
Date/Time picker does not re-draw the up/down spinner RRS feed

  • Question

  • I have a bug in my application where the up/down spinner on time pickers disappears occasionally.

    Screenshot showing example of bug

    I found that it occurs whenever InvalidateRect is called on the parent window.

    Here is a simple reproducible example.

    Does anyone know why this is happening? Is it a bug in Windows or am I doing something wrong?


    • Edited by -DavidH- Tuesday, November 19, 2019 10:20 PM Image didn't upload upon initial post
    • Changed type -DavidH- Wednesday, November 20, 2019 1:55 AM As requested by RLWA32
    Tuesday, November 19, 2019 10:18 PM

Answers

  • Add the WS_CLIPCHILDREN style to the call to CreateWindow for the ChildWindow.

    And the type of post should be a Question, not a Discussion.


    • Edited by RLWA32 Wednesday, November 20, 2019 12:40 AM
    • Marked as answer by -DavidH- Wednesday, November 20, 2019 1:55 AM
    Wednesday, November 20, 2019 12:38 AM

All replies

  • Add the WS_CLIPCHILDREN style to the call to CreateWindow for the ChildWindow.

    And the type of post should be a Question, not a Discussion.


    • Edited by RLWA32 Wednesday, November 20, 2019 12:40 AM
    • Marked as answer by -DavidH- Wednesday, November 20, 2019 1:55 AM
    Wednesday, November 20, 2019 12:38 AM
  • Yeah, I think that did it.

    That did cause some other issues with child windows not being re-drawn at times, but I'll figure that out. Probably just a matter of handling WM_PAINT or WM_ERASEBKGD differently.

    Wednesday, November 20, 2019 1:05 AM
  • I'm still curious to know why this happens?

    Shouldn't the child up/down control be invalidated when the parent is, and therefore receive a WM_PAINT message after the parent is drawn?

    And why does this only affect the up/down control of the date/time picker? I've never had this problem with child Header controls in a ListView or any other sort of complex control.

    Friday, November 22, 2019 3:25 AM