|
-
February 19th, 2000, 09:13 PM
#1
parallel arrays
I need to place products and unit price in a list box straight across from each other as follows:
product1 $4.99
product2 $5.99 etc....
Both products and prices are in two separate arrays. how do I print them so the price is next to the product... someone please help... my code in form load follows... thanks.
-
February 19th, 2000, 09:46 PM
#2
Re: parallel arrays
Try this:
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Any) as Long
private Const LB_SETTABSTOPS = &H192
private Sub Form_Load()
Dim iIndex as Integer
Dim aTabs(0) as Long
aTabs(0) = 70
Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 1, aTabs(0))
for iIndex = 1 to 10
List1.AddItem "Product" & iIndex & Chr(9) & Format(Rnd * 100, "$##.##")
next
End Sub
Replacing the Sample Data with the Products and Prices from your Arrays, when you read the Values back from the List, the Product and Price with be seperated by a Tab, (Chr(9)).
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert: http://www.allexperts.com/displayExp...p?Expert=11884
-
February 20th, 2000, 10:20 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|