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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help with List box

help with List box

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
8 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.
  • N Offline
    N Offline
    NewHSKid
    wrote on last edited by
    #1

    Hi all, I need some help figuring out what to use for my app. I need to have a list of items displayed in a dialog window. I am stuck here because I am not sure I am doing the right thing. The list of item has to be displayed one after another, but one particular type of item has to be in columns. Lets say i want to list sporting equipment and only display the quantity and price for baseball equpi. So an example would be:

       `    Quantity        Price ($)      Total Price  **Baseball hat  4             $25               $100 Baseball ball 11            $5                $55**  Basketball shoes $100 Basketball shorts  $35 Basketball  $40 Soccer ball  $30  **Baseball bat  2             $65               $130**`
    

    Right now I am using a listbox because i don't think a list control will let me span across columns. Can this be done? Is there a way to format the string I add in the list box (using addstring()) to consistantly be in column alignment? THANKS for the help everyone Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

    D 1 Reply Last reply
    0
    • N NewHSKid

      Hi all, I need some help figuring out what to use for my app. I need to have a list of items displayed in a dialog window. I am stuck here because I am not sure I am doing the right thing. The list of item has to be displayed one after another, but one particular type of item has to be in columns. Lets say i want to list sporting equipment and only display the quantity and price for baseball equpi. So an example would be:

         `    Quantity        Price ($)      Total Price  **Baseball hat  4             $25               $100 Baseball ball 11            $5                $55**  Basketball shoes $100 Basketball shorts  $35 Basketball  $40 Soccer ball  $30  **Baseball bat  2             $65               $130**`
      

      Right now I am using a listbox because i don't think a list control will let me span across columns. Can this be done? Is there a way to format the string I add in the list box (using addstring()) to consistantly be in column alignment? THANKS for the help everyone Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Use a list control, with a report style. Give it four columns: Item, Quantity, Price, and Total Price. Empty columns are certainly permissible.


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      N 1 Reply Last reply
      0
      • D David Crow

        Use a list control, with a report style. Give it four columns: Item, Quantity, Price, and Total Price. Empty columns are certainly permissible.


        Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

        N Offline
        N Offline
        NewHSKid
        wrote on last edited by
        #3

        Hi, I wanted to clarify what i needed. I want to be able to add the other types of equpiment as the way i entered in the example as well as write a sentence that will go across the columns. I want to be able to write a description or a cause for the purchases that are made that are not baseball related. So in other words, I want to put to be able to put the paragraph above under the basketball equpiment purchases and before having the last baseball item in the list in the columns again. Can this be done? I couldn't figure this out, so i went with the listbox. This is making it hard to get the baseball equpiment to be lined up though. Any help would be appreciated. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

        D 1 Reply Last reply
        0
        • N NewHSKid

          Hi, I wanted to clarify what i needed. I want to be able to add the other types of equpiment as the way i entered in the example as well as write a sentence that will go across the columns. I want to be able to write a description or a cause for the purchases that are made that are not baseball related. So in other words, I want to put to be able to put the paragraph above under the basketball equpiment purchases and before having the last baseball item in the list in the columns again. Can this be done? I couldn't figure this out, so i went with the listbox. This is making it hard to get the baseball equpiment to be lined up though. Any help would be appreciated. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Sounds like you either need to employ a grid control, or use the LBS_USETABSTOPS style with your listbox.


          Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

          N 1 Reply Last reply
          0
          • D David Crow

            Sounds like you either need to employ a grid control, or use the LBS_USETABSTOPS style with your listbox.


            Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

            N Offline
            N Offline
            NewHSKid
            wrote on last edited by
            #5

            Can a list control insert across columns? Something along the line of merging cells in MS excel? Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

            D 1 Reply Last reply
            0
            • N NewHSKid

              Can a list control insert across columns? Something along the line of merging cells in MS excel? Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Not that I'm aware of, but, I've never tried.


              Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

              N 1 Reply Last reply
              0
              • D David Crow

                Not that I'm aware of, but, I've never tried.


                Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

                N Offline
                N Offline
                NewHSKid
                wrote on last edited by
                #7

                Hi, would you be offended if i asked this to other members of the forum? (post a new message about this?) thanks again for your help Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

                D 1 Reply Last reply
                0
                • N NewHSKid

                  Hi, would you be offended if i asked this to other members of the forum? (post a new message about this?) thanks again for your help Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Why would I be offended? It's not my forum.


                  Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

                  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