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. listbox custom draw

listbox custom draw

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    roel_
    wrote on last edited by
    #1

    Hi, I have a custom draw list box, I handle WM_DRAWITEM to draw the items but it seems that only the selected items are drawn. The others aren't being invalidated. Anyone know why? cheers, roel

    J 1 Reply Last reply
    0
    • R roel_

      Hi, I have a custom draw list box, I handle WM_DRAWITEM to draw the items but it seems that only the selected items are drawn. The others aren't being invalidated. Anyone know why? cheers, roel

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      Are you checking the item state and setting TextColor correctly? (DRAWITEMSTRUCT::itemState) That's just a guess, without code it's hard to tell what's going wrong. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      R 1 Reply Last reply
      0
      • J Joe Woodbury

        Are you checking the item state and setting TextColor correctly? (DRAWITEMSTRUCT::itemState) That's just a guess, without code it's hard to tell what's going wrong. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        R Offline
        R Offline
        roel_
        wrote on last edited by
        #3

        Thanks for your reply, after letting it rest and getting some sleep it only took me 10 minutes to find it ;) Problem was that I was using WTL's CDC and not CDCHandle, CDC destroys the DC when it goes out of scope... Argh stupid me, I've made this mistakes dozens of times for fonts and cursors and bitmaps, just when I thought that I wouldn't make it again this shows up... Anyway thanks for your answer.

        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