|
-
Feb 15th, 2001, 11:28 AM
#1
Thread Starter
Hyperactive Member
I am using a combobox with 8 items in it.
How do I know which item the user has selected, i.e.,
combo1.listindex is 0 even tho the user has already
select something.
Thanks for the help.
-
Feb 15th, 2001, 11:30 AM
#2
-
Feb 15th, 2001, 11:36 AM
#3
Addicted Member
Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub
Private Sub Form_Load()
Combo1.AddItem "One", 0
Combo1.AddItem "Two", 1
Combo1.AddItem "Three", 2
Combo1.AddItem "Four", 3
Combo1.AddItem "Five", 4
Combo1.AddItem "Six", 5
Combo1.AddItem "Seven", 6
Combo1.Text = "One"
End Sub
-
Feb 15th, 2001, 11:37 AM
#4
Thread Starter
Hyperactive Member
Hi Cander,
Sorry for not being clear. What I really want is the
index of the combo item and not the text because
I have another object that I must match the index
of the combo box to.
Example:
cboItems(0).text = "APPLE" cboPrice(0).text = "$1.4"
cboItems(1).text = "PEAR" cboPrice(1).text = "$1.0"
cboItems(2).text = "PIE" cboPrice(2).text = "$0.4"
So when the user selected "PEAR" I want to read
the value from cboPrice(1).text
-
Feb 15th, 2001, 11:39 AM
#5
oh..my bad..
-
Feb 15th, 2001, 11:53 AM
#6
Thread Starter
Hyperactive Member
found the answer/problem:
Answer: use the cboItems_click()
cboItems.ListIndex
Problem: cboItems_Change()
will return -1 for cboItems.ListIndex
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
|