DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Add numbers from a list to textbox

  1. #1
    Join Date
    Feb 2007
    Posts
    3

    Add numbers from a list to textbox

    hi all

    I am trying to add numbers from a listbox to text in vb6

    i have a list and numbers in it
    and a textbox

    i would like the sum of what's inside the list to appear inside the textbox
    can ou help me with this??

    thanx in advance
    weso.n

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    Dim I As Integer
    Dim sum As Long
    
    For I = 0 To lstBox.ListCount - 1
        sum = sum + Val(lstBox.List(I))
    Next
    
    txtBox.Text = sum
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Feb 2007
    Posts
    3
    thaaaaaaaaaaaaaaaaanx maaaan

    you are the best

    may god pless you

Similar Threads

  1. List Box vs TextBox properties in Access reports
    By arturo63 in forum VB Classic
    Replies: 0
    Last Post: 08-07-2006, 11:19 AM
  2. Replies: 1
    Last Post: 07-07-2006, 05:37 AM
  3. Problem with linked lists and iterators
    By white94cam in forum C++
    Replies: 2
    Last Post: 03-31-2005, 12:02 AM
  4. Replies: 0
    Last Post: 07-24-2002, 09:11 AM
  5. Replies: 1
    Last Post: 02-22-2002, 02:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center