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. Problem about ListBox item

Problem about ListBox item

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
3 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.
  • C Offline
    C Offline
    Chen XuNuo
    wrote on last edited by
    #1

    I seen many examples about ListBox,in DrawItem they use the state and the action to decide how the item should be drawn. I am puzzled that what is difference between focus and the select or selected.Besides,is the whole ListBox redrawn when I click the item when the program are running?Could somebody give details~? Thanks~

    M D 2 Replies Last reply
    0
    • C Chen XuNuo

      I seen many examples about ListBox,in DrawItem they use the state and the action to decide how the item should be drawn. I am puzzled that what is difference between focus and the select or selected.Besides,is the whole ListBox redrawn when I click the item when the program are running?Could somebody give details~? Thanks~

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

      In many controls (like a standard listbox) the focus state and selected state are set at the same time. Having both states gives custom controls a way to indicate keyboard focus without an item being selected or vice-versa.

      "If you can dodge a wrench, you can dodge a ball."

      1 Reply Last reply
      0
      • C Chen XuNuo

        I seen many examples about ListBox,in DrawItem they use the state and the action to decide how the item should be drawn. I am puzzled that what is difference between focus and the select or selected.Besides,is the whole ListBox redrawn when I click the item when the program are running?Could somebody give details~? Thanks~

        D Offline
        D Offline
        DLChambers
        wrote on last edited by
        #3

        In the standard listbox rendering, Focus typically draws a dashed rect around the "current" item and Selected shows the item in color. The difference is useful if you want to e.g. keep the Selected item highlighted when the listbox is not focused. Usually only the affected items are redrawn. For example, if you have item 1 selected and click on item 2, you'd get draw messages for item 1 (with the selected flag cleared) and item 2 (with the selected flag set), but no draw msgs for items 0 or 3. If oyu *scroll* the listbox you'll get draw messages for all visible (either partially or fully) items, but not for those items whose rects fall outside (above/below) the window's client area.

        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