|
-
Nov 14th, 1999, 08:57 AM
#1
Thread Starter
Lively Member
hmm the code you gave me to use works ok as long as the sort property of the combo box is set to false when i change it to true the wrong price gets loaded in the index somehow gets mixed up any ideas on how to fix this or do i have to write subroutine to keep this from happening my post from two days ago
ok lets see if i can word this correctly enough to make sense lets say i have a list of stuff in a flat file eg
bread|2.50
milk|1.50
cheese|4.50 now i declared a array with this
type TagStuff
strStuff as string
dblCost as double
end type
public S_taglist() as TagStuff
I then only load the first part of the array
into a combolist box that i have done ok no problems.Then when i select the text in the
combo box it has to go to a flexgrid with two colums one for the strSuff and another
for dblCost i not sure how to load the dblCost part of the array into the second columm so that when the text is added to the
gird the PROPER cost of the item is added also
Private Sub cmdAddList_Click()
If cboList.Text = "" Then ExitSub
grdItemSelect.Col = 1
grdItemSelect.Row = intstuffCount + 1
grdItemSelect.Text = cboList.Text
grditemSelect.Col = 2
grdItemselect.Text=????
intStuffCount = intStuffCount + 1
grdMovieSelect.Rows = intStuffCount + 2
cboListText = ""
----------------
Private Sub cmdAddList_Click()
If ListIndex<0 Then Exit Sub 'You Can Add More Than One Column At a Time using Chr(9) 'Tab' As a Seperator
grdItemSelect.AddItem cboList & Chr(9) & s_TagList(cboList.ListIndex).dblCost
End Sub
By the way nice homepage cool way to meet your wife too. you are gonna have to learn how to play 8-ball now, no more snooker
i only play 8-ball now, our team usally wins a trip to vegas for the international 8ball
tournement every year 
-
Nov 14th, 1999, 09:44 AM
#2
The easiest way would probably be to store the Array Index Number in the ItemData Property of each Combo List Item, eg.
sTagList(iIndex).strStuff = "Some Item"
sTagList(iIndex).dblCost = 2.95
Combo1.AddItem sTagList(iIndex).strStuff
Combo1.ItemData(Combo1.NewIndex) = iIndex
Code:
Private Sub cmdAddList_Click()
If cboList.ListIndex < 0 Then Exit Sub
grdItemSelect.AddItem cboList & Chr(9) & s_TagList(cboList.ItemData(cboList.ListIndex)).dblCost
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|