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. Owner drawn List box...problem in setting item height.

Owner drawn List box...problem in setting item height.

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

    Hi all. In an owner drawn list box, when I try to set the item height by ... -------------------------------------------------------------------- void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = m_nHeight; } -------------------------------------------------------------------- I have defined m_nHeight as a class memner and its of an int type. I am setting its value with the help of another function... SetItemHeight(int nVal). When I pass the values for m_nHeight to be greater than 255, then the values got truncated... Eg. 1. When I passed 300, the item height was set to 300-256 = 49. 2. When I passed 400, the item height was set to 400-256 = 149. etc. I have taken care to set the proper data types for m_nHeight, and data type of lpMeasureItemStruct->itemHeight is UINT. Then what could be the reason behind this value truncation? Thanks

    Sameer Thakur

    C 1 Reply Last reply
    0
    • S Sameer_Thakur

      Hi all. In an owner drawn list box, when I try to set the item height by ... -------------------------------------------------------------------- void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = m_nHeight; } -------------------------------------------------------------------- I have defined m_nHeight as a class memner and its of an int type. I am setting its value with the help of another function... SetItemHeight(int nVal). When I pass the values for m_nHeight to be greater than 255, then the values got truncated... Eg. 1. When I passed 300, the item height was set to 300-256 = 49. 2. When I passed 400, the item height was set to 400-256 = 149. etc. I have taken care to set the proper data types for m_nHeight, and data type of lpMeasureItemStruct->itemHeight is UINT. Then what could be the reason behind this value truncation? Thanks

      Sameer Thakur

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      from MSDN [^]: The maximum height of a list box item is 255. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      V 1 Reply Last reply
      0
      • C CPallini

        from MSDN [^]: The maximum height of a list box item is 255. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        V Offline
        V Offline
        Vobulator
        wrote on last edited by
        #3

        And is there any way to overwrite this limitation?

        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