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. Ownerdrawn Listbox

Ownerdrawn Listbox

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsonquestion
6 Posts 3 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.
  • K Offline
    K Offline
    KellyR
    wrote on last edited by
    #1

    Hi, I'm looking for a way to do a completely owner-drawn Listbox in C++ with just the Windows API and without MFC. The LBS_OWNERDRAWFIXED allows me to draw the items in the list, but is there a way for me to owner-draw the entire listbox (along with the scroll bars, etc)? Or do I have to subclass the listbox and draw it when it receives WM_PAINT? Thanks!

    KR

    L M 2 Replies Last reply
    0
    • K KellyR

      Hi, I'm looking for a way to do a completely owner-drawn Listbox in C++ with just the Windows API and without MFC. The LBS_OWNERDRAWFIXED allows me to draw the items in the list, but is there a way for me to owner-draw the entire listbox (along with the scroll bars, etc)? Or do I have to subclass the listbox and draw it when it receives WM_PAINT? Thanks!

      KR

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Well owner draw does what it does. You can't make it do something it doesn't do. Does that answer your question?

      led mike

      K 1 Reply Last reply
      0
      • L led mike

        Well owner draw does what it does. You can't make it do something it doesn't do. Does that answer your question?

        led mike

        K Offline
        K Offline
        KellyR
        wrote on last edited by
        #3

        I was hoping there was a listbox ownerdraw style that would have the same behavior as BS_OWNERDRAW does for buttons. I guess you're saying there isn't one?

        KR

        L 1 Reply Last reply
        0
        • K KellyR

          I was hoping there was a listbox ownerdraw style that would have the same behavior as BS_OWNERDRAW does for buttons. I guess you're saying there isn't one?

          KR

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          KellyR wrote:

          I guess you're saying there isn't one?

          Yes. As far as I know there is only one owner draw mechanism for each control that supports owner draw.

          led mike

          K 1 Reply Last reply
          0
          • L led mike

            KellyR wrote:

            I guess you're saying there isn't one?

            Yes. As far as I know there is only one owner draw mechanism for each control that supports owner draw.

            led mike

            K Offline
            K Offline
            KellyR
            wrote on last edited by
            #5

            ok, thanks!

            KR

            1 Reply Last reply
            0
            • K KellyR

              Hi, I'm looking for a way to do a completely owner-drawn Listbox in C++ with just the Windows API and without MFC. The LBS_OWNERDRAWFIXED allows me to draw the items in the list, but is there a way for me to owner-draw the entire listbox (along with the scroll bars, etc)? Or do I have to subclass the listbox and draw it when it receives WM_PAINT? Thanks!

              KR

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              With a listview control, you could maybe take advantage of custom draw... Customizing a Control's Appearance Using Custom Draw[^] Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              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