• 0

[VB6.0]computing listbox values


Question

hello ,

i have program with listbox which hold multiple string

using

list1.additem CI &";"& Quantity &";"& itemunitprice

the subprogram look as following

what i went to do is multiple Quantity with itemunitprice from the listbox then move to secound item in the list doing the same thing

then adding them up and displaying them in balance textbox

any help are apreciated thx

update:

my problem nearly solved , one last thing

 Dim A As String
   Dim B As String
   Dim c As String
   Dim l As Integer
	 For l = 0 To List1.ListCount
	 TXTB = 0
		 If List1.Selected(l) = True Then
			 A = Split(List1.List(l), ";" & ";")(1)
			 B = Split(List1.List(l), ";")(1)
			 c = Val(A) * Val(B)
		 End If
		 l = l + 1
		 TXTB = TXTB + Val(c)
	 Next l
 End Sub

does that look right , for the purpose of looping throgh the listbox ?

post-254628-1237215082_thumb.png

Edited by skynetXrules
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Try using a Listview rather than a Listbox.

thx for the replay

who do i get to do that ? more importantly were do i find listview ,i have look for it couldnt find it ??

edit :just found it in component list

Edited by skynetXrules
Link to comment
Share on other sites

  • 0
skynetXrule : PM me your email address and I will send you some code that might help.

thanks man :) , i was puzzled from few days about who to do .... etc

i have checked your mail out ,your concept works nicely with my implementations

thanks again

regards,

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.