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. Changing CListBox sort at runtime

Changing CListBox sort at runtime

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • D Offline
    D Offline
    Daniel1324
    wrote on last edited by
    #1

    I use the listbox for two purposes, for one, I need the sort on. For the other, the sort off so contents wont be sorted alphabetically. How can I change that setting at with code at runtime? Thanks!

    V 1 Reply Last reply
    0
    • D Daniel1324

      I use the listbox for two purposes, for one, I need the sort on. For the other, the sort off so contents wont be sorted alphabetically. How can I change that setting at with code at runtime? Thanks!

      V Offline
      V Offline
      vcplusplus
      wrote on last edited by
      #2

      Use ModifyStyle() This is what I did to change from ascending to descending. myListBoxCtrl.ModifyStyle(LVS_SORTASCENDING, LVS_SORTDESCENDING);

      D 1 Reply Last reply
      0
      • V vcplusplus

        Use ModifyStyle() This is what I did to change from ascending to descending. myListBoxCtrl.ModifyStyle(LVS_SORTASCENDING, LVS_SORTDESCENDING);

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

        Cant figure out how to just remove LBS_SORT and nothing else. Dang!

        V 1 Reply Last reply
        0
        • D Daniel1324

          Cant figure out how to just remove LBS_SORT and nothing else. Dang!

          V Offline
          V Offline
          vcplusplus
          wrote on last edited by
          #4

          Check out this web site http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cwnd.3a3a.modifystyle.asp?frame=true

          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