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. Visual Basic
  4. List Boxes

List Boxes

Scheduled Pinned Locked Moved Visual Basic
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
    dexter9703
    wrote on last edited by
    #1

    How can I code to get a calculated answer which is shown in a textbox to a listbox, and further answers added to that list box. :confused:

    D 1 Reply Last reply
    0
    • D dexter9703

      How can I code to get a calculated answer which is shown in a textbox to a listbox, and further answers added to that list box. :confused:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your question doesn't provide any details, but you add a string, even if it's the result of a calculation, to a listbox by doing something like:

      Dim result As Integer = x \* y
      ListBox1.Items.Add(result.ToString("N"))
      

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      D 2 Replies Last reply
      0
      • D Dave Kreskowiak

        Your question doesn't provide any details, but you add a string, even if it's the result of a calculation, to a listbox by doing something like:

        Dim result As Integer = x \* y
        ListBox1.Items.Add(result.ToString("N"))
        

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

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

        I have the product of a quantity and price (both doubles) to give total dim total as double the total is then displayed in a textbox when a button is clicked. How would I get this result (total) in a listbox by clicking a button, and other subsequent results into that listbox. What is "N" in your above response Thank you :~

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          Your question doesn't provide any details, but you add a string, even if it's the result of a calculation, to a listbox by doing something like:

          Dim result As Integer = x \* y
          ListBox1.Items.Add(result.ToString("N"))
          

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          D Offline
          D Offline
          dexter9703
          wrote on last edited by
          #4

          It works thanks a million. With the totals displayed in the listbox, how can I find the total of the numbers displayed to with two decimal places

          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