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. Paint problems during scrolling

Paint problems during scrolling

Scheduled Pinned Locked Moved C / C++ / MFC
wpfgraphicsdata-structures
1 Posts 1 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.
  • M Offline
    M Offline
    misha_grewal
    wrote on last edited by
    #1

    I have a CTreeCtrl derived class which does heavy custom drawing for various styles. One of the style is "Right justified" item, that is a tree item should be drawn at the right most corner of the window. Its an hyperlink as well. I have handled NM_CUSTOMDRAW, and I do painting in PrePaint and say a Skip Default to prevent the custom drawn items to be painted again. The code looks like this (Excerpt only) GetItemRect(hItem, textRect, TRUE); //this gets the rect for text only GetItemRect(hItem, itemRect, FALSE); //get the text for full item area if ( itemStyle is Right Justified ) { // subtract offset for right justified itemRect.right -= _offsetRTJustifed; itemRect.left = itemRect.right - textRect.Width(); pDC->DrawText(sItemText, &itemRect, DT_LEFT); } This right justified item is added under a root item and appears when user expands that root item. When the user plays around with the tree items, expanding and collapsing often, the vertical scroll bar appears and disappears as per the number of tree items. Due to this scroll bar appearing/disappearing, the painting of this right justified item gets garbled. (It seems as if the paint messages are lost in between very frequent scroll bar displays/removals).. Its difficult to suggest, but would appreciate if somebody has a clue about it.. Thanks

    Evil triumphs when good people sit quiet...

    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