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. bind data in List Box

bind data in List Box

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

    Each item in the list box has a bind data( set with the func 'SetItemData') , if I delete the item which who's index is 7(based zero), so now , is the new 7 indexed item has the last eighth item's data or seventh 's data ?

    C 1 Reply Last reply
    0
    • S steviewang

      Each item in the list box has a bind data( set with the func 'SetItemData') , if I delete the item which who's index is 7(based zero), so now , is the new 7 indexed item has the last eighth item's data or seventh 's data ?

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

      the new 7 indexed item will be the old 8th item(with its data set with SetItemData). list box will handle this internally whenever you delete an item from it. If you set a pointer to some dynamically allocated memory as SetItemData(index, ptr), take care to delete that memory before removing the list box item, if you don't need that memory again.

      S 1 Reply Last reply
      0
      • C Cool_Dev

        the new 7 indexed item will be the old 8th item(with its data set with SetItemData). list box will handle this internally whenever you delete an item from it. If you set a pointer to some dynamically allocated memory as SetItemData(index, ptr), take care to delete that memory before removing the list box item, if you don't need that memory again.

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

        Thank you! I just know where are you come from? :)

        C 1 Reply Last reply
        0
        • S steviewang

          Thank you! I just know where are you come from? :)

          C Offline
          C Offline
          Cool_Dev
          wrote on last edited by
          #4

          you may email the forum members for further activitiees.. no such discussions here please. :)

          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