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. List box customization..Problem with setting the item Height.

List box customization..Problem with setting the item Height.

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

    Hi all. I am trying to customize a List box to load the jpg preview images in it. I have managed to load all the jpg files in a list box; one below the other from the selected location. But by default the preview height is 16 pixels. I tried to change it to 200 by following way… void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = 200; } but the height is remaining the same (16 pixels). How can I set the height to the desired pixel amount? Thanks

    Sameer Thakur

    S 1 Reply Last reply
    0
    • S Sameer_Thakur

      Hi all. I am trying to customize a List box to load the jpg preview images in it. I have managed to load all the jpg files in a list box; one below the other from the selected location. But by default the preview height is 16 pixels. I tried to change it to 200 by following way… void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = 200; } but the height is remaining the same (16 pixels). How can I set the height to the desired pixel amount? Thanks

      Sameer Thakur

      S Offline
      S Offline
      sthotakura
      wrote on last edited by
      #2

      Did you create your ListBox with Owner-draw style (LBS_OWNERDRAWVARIABLE)? If not try creating with the style.

      S 1 Reply Last reply
      0
      • S sthotakura

        Did you create your ListBox with Owner-draw style (LBS_OWNERDRAWVARIABLE)? If not try creating with the style.

        S Offline
        S Offline
        Sameer_Thakur
        wrote on last edited by
        #3

        Yes I have set the property of "Owner Draw" to "variablr" under style tab. Also checked the option of "Has String" under it.

        Sameer Thakur

        S 1 Reply Last reply
        0
        • S Sameer_Thakur

          Yes I have set the property of "Owner Draw" to "variablr" under style tab. Also checked the option of "Has String" under it.

          Sameer Thakur

          S Offline
          S Offline
          sthotakura
          wrote on last edited by
          #4

          In WM_DRAWITEM handler, did you set the property CtlType of DRAWITEMSTRUCT to ODT_LISTBOX?

          S 1 Reply Last reply
          0
          • S sthotakura

            In WM_DRAWITEM handler, did you set the property CtlType of DRAWITEMSTRUCT to ODT_LISTBOX?

            S Offline
            S Offline
            Sameer_Thakur
            wrote on last edited by
            #5

            No initialy I did not. But I have added it now but still the item size is not getting changed.

            Sameer Thakur

            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