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. Managed C++/CLI
  4. CListBox::SetItemData equivalent?

CListBox::SetItemData equivalent?

Scheduled Pinned Locked Moved Managed C++/CLI
csharphtmlcomquestion
12 Posts 4 Posters 33 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.
  • C Christian Graus

    Does SetItemData put hidden information in ? I don't recall seeing anything similar to that. I know for items that are visible you need to create a new instance of an item or subitem and then pass it in, but I don't think it has a data field. Christian We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )

    N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #3

    Blast!!! Say I have a listbox with the following stuff apple orange grapes orange banana apple Notice how apple and orange appear twice. Now to internally differentiate these items [because they are the textual casts of a more complex actual object] I'd need to associate an id with each. apple [ap1] orange [or1] grapes [grp] orange [or45] banana [bnna] apple [ap6] See? How do I do that??? Regards Nish p.s. The intention is this. If the guy has selected an item that appears multiple times, I should be able to get the id associated with it!


    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

    S C 2 Replies Last reply
    0
    • N Nish Nishant

      Blast!!! Say I have a listbox with the following stuff apple orange grapes orange banana apple Notice how apple and orange appear twice. Now to internally differentiate these items [because they are the textual casts of a more complex actual object] I'd need to associate an id with each. apple [ap1] orange [or1] grapes [grp] orange [or45] banana [bnna] apple [ap6] See? How do I do that??? Regards Nish p.s. The intention is this. If the guy has selected an item that appears multiple times, I should be able to get the id associated with it!


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #4

      Dude, what's with the large fonts? Don't tell me your vision is going now...

      ---

      Shog9 If I could sleep forever, I could forget about everything...

      N 1 Reply Last reply
      0
      • S Shog9 0

        Dude, what's with the large fonts? Don't tell me your vision is going now...

        ---

        Shog9 If I could sleep forever, I could forget about everything...

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #5

        Shog9 wrote: Dude, what's with the large fonts? Don't tell me your vision is going now... Alright, alright! I am not allowed to feed the lions, I am not allowed to sing aloud. Other people get to use big fonts, I never get to do anything. I am sulking. Hey, I tho I tho a puthy cath...... I deedh, I deedh tho a puthy cath... [Sigh] This list box issue is frustrating me Shog :-(


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

        S 1 Reply Last reply
        0
        • N Nish Nishant

          Shog9 wrote: Dude, what's with the large fonts? Don't tell me your vision is going now... Alright, alright! I am not allowed to feed the lions, I am not allowed to sing aloud. Other people get to use big fonts, I never get to do anything. I am sulking. Hey, I tho I tho a puthy cath...... I deedh, I deedh tho a puthy cath... [Sigh] This list box issue is frustrating me Shog :-(


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #6

          Hey, it's ok by me if you want to feed the lions. Nishant S wrote: Hey, I tho I tho a puthy cath...... I deedh, I deedh tho a puthy cath What?!? (w0t) *you're* Tweety now? Nishant S wrote: This list box issue is frustrating me Admittedly, i know nothing about anything, but - can't you just create a class containing two data items, add a toString member, & be done with it? Should still be fairly concise i should think. Or am i missing the point.

          ---

          Shog9 If I could sleep forever, I could forget about everything...

          N 1 Reply Last reply
          0
          • S Shog9 0

            Hey, it's ok by me if you want to feed the lions. Nishant S wrote: Hey, I tho I tho a puthy cath...... I deedh, I deedh tho a puthy cath What?!? (w0t) *you're* Tweety now? Nishant S wrote: This list box issue is frustrating me Admittedly, i know nothing about anything, but - can't you just create a class containing two data items, add a toString member, & be done with it? Should still be fairly concise i should think. Or am i missing the point.

            ---

            Shog9 If I could sleep forever, I could forget about everything...

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #7

            Shog9 wrote: Admittedly, i know nothing about anything, but - can't you just create a class containing two data items, add a toString member, & be done with it? Should still be fairly concise i should think. Or am i missing the point. Shog!!!! :omg: Has anyone ever told you that you are a miraculous genius whose existence on this planet is truly an unbelievable phenomenon of astonishing proportions? Nish!! p.s. It bloody damn well worked!!! :eek:


            Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

            S 1 Reply Last reply
            0
            • N Nish Nishant

              Shog9 wrote: Admittedly, i know nothing about anything, but - can't you just create a class containing two data items, add a toString member, & be done with it? Should still be fairly concise i should think. Or am i missing the point. Shog!!!! :omg: Has anyone ever told you that you are a miraculous genius whose existence on this planet is truly an unbelievable phenomenon of astonishing proportions? Nish!! p.s. It bloody damn well worked!!! :eek:


              Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #8

              I should see if i can't get some money out of MS for a testimonial: "Has anyone ever told you that you are a miraculous genius whose existence on this planet is truly an unbelievable phenomenon of astonishing proportions? Buy MSDN, and hear it daily!" Nishant S wrote: It bloody damn well worked!!! Kewl :)

              ---

              Shog9 If I could sleep forever, I could forget about everything...

              N 1 Reply Last reply
              0
              • N Nish Nishant

                Blast!!! Say I have a listbox with the following stuff apple orange grapes orange banana apple Notice how apple and orange appear twice. Now to internally differentiate these items [because they are the textual casts of a more complex actual object] I'd need to associate an id with each. apple [ap1] orange [or1] grapes [grp] orange [or45] banana [bnna] apple [ap6] See? How do I do that??? Regards Nish p.s. The intention is this. If the guy has selected an item that appears multiple times, I should be able to get the id associated with it!


                Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #9

                I dunno, given that the Win32 boxes do it, you'd think it was possible. If not, could you put the data in another column and hide it, by forcing it to be 0 pixels wide ? I'll be home in two hours, if there's no other answer by then, I can check in Petzold. Christian We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )

                1 Reply Last reply
                0
                • S Shog9 0

                  I should see if i can't get some money out of MS for a testimonial: "Has anyone ever told you that you are a miraculous genius whose existence on this planet is truly an unbelievable phenomenon of astonishing proportions? Buy MSDN, and hear it daily!" Nishant S wrote: It bloody damn well worked!!! Kewl :)

                  ---

                  Shog9 If I could sleep forever, I could forget about everything...

                  N Offline
                  N Offline
                  Nish Nishant
                  wrote on last edited by
                  #10

                  I am guessing that you do eat a lot of fish, eh Shog? Nothing else could explain this :-) By the way I have added the missing "are" in my post, but by the time I had done that you had already replied and quoted the sentence. I usually never correct typo errors, this time I did it, just in case MSDN or Dundas decides to use you as their model ;-) Nish


                  Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                  S 1 Reply Last reply
                  0
                  • N Nish Nishant

                    I am guessing that you do eat a lot of fish, eh Shog? Nothing else could explain this :-) By the way I have added the missing "are" in my post, but by the time I had done that you had already replied and quoted the sentence. I usually never correct typo errors, this time I did it, just in case MSDN or Dundas decides to use you as their model ;-) Nish


                    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                    S Offline
                    S Offline
                    Shog9 0
                    wrote on last edited by
                    #11

                    Nishant S wrote: I am guessing that you do eat a lot of fish, eh Shog? Smoked salmon count? Nishant S wrote: I usually never correct typo errors, this time I did it, just in case MSDN or Dundas decides to use you as their model Hey, if i'd get to meet that summer bikini model i'd go for it ;)

                    ---

                    Shog9 If I could sleep forever, I could forget about everything...

                    1 Reply Last reply
                    0
                    • N Nish Nishant

                      What's the .NET equivalent of CListBox::SetItemData? I didn't find anything analogous in the ListBox class :-( Nish


                      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                      N Offline
                      N Offline
                      Nick Hodapp
                      wrote on last edited by
                      #12

                      The ListBox control can contain any Object derived class, not simply strings. To display a value, ListBox calls the Object::ToString(), which you can override on your own types. This means that you can insert items that contain more than 32bits of "Item Data". Note for ListViews, use the ListItem "Tag" property to store user-information (of any type). This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.

                      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