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. CListCtrl in LVS_ICON mode with no text

CListCtrl in LVS_ICON mode with no text

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • G Offline
    G Offline
    GregH
    wrote on last edited by
    #1

    I am working on implementing a CListCtrl derived class that functions similar to a control bar. Each icon functions like a button, icon only with no text assigned, and the layout (# of rows/columns) is adjusted as the size of the control changes. All the icons are displayed packed together with a single pixel separating them vertically and horizontally. I have just about everything working, but have run into one problem I cannot find a solution for. When there are multiple rows displayed in the control, even though no text is displayed for any icon, space for the text is being calculated. Clicking on an icon in a row other than the top row results in the icon in the row above being selected - if the click happens in the space where the text of the upper item would appear, if there were any. To put it another way, the space where text would appear for icon in Row A overhangs the icons in Row B. Clicking in this 'overhang' space results in the icon in Row A being selected, while visually it appears that the click happened well within Row B. Any ideas on how to make the list control not calculate the space for the text label?

    R 1 Reply Last reply
    0
    • G GregH

      I am working on implementing a CListCtrl derived class that functions similar to a control bar. Each icon functions like a button, icon only with no text assigned, and the layout (# of rows/columns) is adjusted as the size of the control changes. All the icons are displayed packed together with a single pixel separating them vertically and horizontally. I have just about everything working, but have run into one problem I cannot find a solution for. When there are multiple rows displayed in the control, even though no text is displayed for any icon, space for the text is being calculated. Clicking on an icon in a row other than the top row results in the icon in the row above being selected - if the click happens in the space where the text of the upper item would appear, if there were any. To put it another way, the space where text would appear for icon in Row A overhangs the icons in Row B. Clicking in this 'overhang' space results in the icon in Row A being selected, while visually it appears that the click happened well within Row B. Any ideas on how to make the list control not calculate the space for the text label?

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      You may want to look into handling WM_MEASUREITEM. See this[^] article. /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      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