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. Listbox control

Listbox control

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorialquestion
5 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
    srija
    wrote on last edited by
    #1

    How to output an array of datatype CString and of size[2400]in a Listbox control????

    G 1 Reply Last reply
    0
    • S srija

      How to output an array of datatype CString and of size[2400]in a Listbox control????

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      CString array[2400];
      CListBox listbox;
      for (int i = 0; i < 2400; i++) {
      listbox.AddString(array[i]);
      }


      Software Zen: delete this;

      Fold With Us![^]

      S 1 Reply Last reply
      0
      • G Gary R Wheeler

        CString array[2400];
        CListBox listbox;
        for (int i = 0; i < 2400; i++) {
        listbox.AddString(array[i]);
        }


        Software Zen: delete this;

        Fold With Us![^]

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

        Ya thank you very much for ur reply, whatever you have written is correct and i was owrking int he same way, but i was encountering an error while using with two dimensional arrays.How could i use for two dimensional arrays? CString average[100][100]; CListBox m_stravevalues; for(i=0;i<60;i++) for(j=0;j<40;j++) { m_stravevalues.AddString(average[i][j]); } Is this correct???

        B 1 Reply Last reply
        0
        • S srija

          Ya thank you very much for ur reply, whatever you have written is correct and i was owrking int he same way, but i was encountering an error while using with two dimensional arrays.How could i use for two dimensional arrays? CString average[100][100]; CListBox m_stravevalues; for(i=0;i<60;i++) for(j=0;j<40;j++) { m_stravevalues.AddString(average[i][j]); } Is this correct???

          B Offline
          B Offline
          Bram van Kampen
          wrote on last edited by
          #4

          Not Correct, A Listbox is One Dimensional, and cannot display 2 Dimensions. Maybe you're looking for a Multi Colum listbox?? LateNightsInNewry

          S 1 Reply Last reply
          0
          • B Bram van Kampen

            Not Correct, A Listbox is One Dimensional, and cannot display 2 Dimensions. Maybe you're looking for a Multi Colum listbox?? LateNightsInNewry

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

            So, anybody could help me, to output this two dimensional array in a List box or Edit box.

            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