Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Refresh/redraw controls in CFormView

Refresh/redraw controls in CFormView

Scheduled Pinned Locked Moved C / C++ / MFC
comgraphicsdata-structuresquestionannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jaknupp
    wrote on last edited by
    #1

    I have a CFormView with 2 CStatic bitmaps used for backgrounds. One has an ActiveX graph control above it and the other has another bitmap. Z order is set so background bitmaps are on the bottom. Clip children and clip siblings are set. When first displayed everything looks good. After minimize/restore or covered by another window the background bitmaps display above the other controls. To test I added a button and have the handler in CFormView that does m_graph.Invalidate() and m_foregroundbitmap.Invalidate(). When pushed the graph and forground bitmap display correctly. I also tried having the button handler just do Invalidate() (for the form view) which also displays correctly. Putting Invalidate() in any other handler (i.e. OnSize, OnActivate) doesn't work. It seems that the graph and foreground bitmap update but then the background bitmaps update and draw over the others. Setting Invalidate() in OnParentNotify() from the graph control does work but unless the mouse is over the control there's no notify messages so no update. I've also tried SetWindowPos(&CWnd::wndTopMost... which didn't seem to change anything. Are there any ideas on what I might be missing or maybe another way to have controls over an image? (I need the background image because it gives a quick view to what changed in the control.) Thanks, John

    K 1 Reply Last reply
    0
    • J jaknupp

      I have a CFormView with 2 CStatic bitmaps used for backgrounds. One has an ActiveX graph control above it and the other has another bitmap. Z order is set so background bitmaps are on the bottom. Clip children and clip siblings are set. When first displayed everything looks good. After minimize/restore or covered by another window the background bitmaps display above the other controls. To test I added a button and have the handler in CFormView that does m_graph.Invalidate() and m_foregroundbitmap.Invalidate(). When pushed the graph and forground bitmap display correctly. I also tried having the button handler just do Invalidate() (for the form view) which also displays correctly. Putting Invalidate() in any other handler (i.e. OnSize, OnActivate) doesn't work. It seems that the graph and foreground bitmap update but then the background bitmaps update and draw over the others. Setting Invalidate() in OnParentNotify() from the graph control does work but unless the mouse is over the control there's no notify messages so no update. I've also tried SetWindowPos(&CWnd::wndTopMost... which didn't seem to change anything. Are there any ideas on what I might be missing or maybe another way to have controls over an image? (I need the background image because it gives a quick view to what changed in the control.) Thanks, John

      K Offline
      K Offline
      KingsGambit
      wrote on last edited by
      #2

      Z-Order for the child controls will not work for displaying a child window on the top of another. What you can do is instead of using a CStatic control for displaying the bitmap, you can render the bitmap directly on to the parent window.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups