how to get combobox selection?

how to get combobox selection?

Anonymous
Not applicable
453 Views
7 Replies
Message 1 of 8

how to get combobox selection?

Anonymous
Not applicable
Hi,
i cant find either a .Value nor a .Selection property for a combo box in vb6
This should be so obvious and easy but I've been searching google for 3
hours and can't find any posts saying how to get the silly value of what's
selected?
Someone said use the .value property but there isn't one, at least in the
properties box or in the tool tip with autoinfo or whatever that's called
where it offers you selections when you put a period after the object.
Any help appreciated.
0 Likes
454 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
okay, I know It's supposed to be .ListIndex but I can't get that to work
either
maybe I'm doing something else wrong.
with this sub in the form module,

Private Sub cboFuncList_DblClick()
Debug.Print cboFuncList.ListIndex
End Sub

shouldn't I see the selection value in the immediate window after double
clicking in the cbo box?

MP wrote in message
news:4109514C6BAA5662413D6E28E1444C53@in.WebX.maYIadrTaRb...
> Hi,
> i cant find either a .Value nor a .Selection property for a combo box in
vb6
0 Likes
Message 3 of 8

Anonymous
Not applicable
I had also tried

Private Sub cboFuncList_KeyUp(KeyCode As Integer, Shift As Integer)
Debug.Print cboFuncList.Value
'and
'Debug.Print cboFuncList.ItemData(cboFuncList.ListIndex)
'and
'Debug.Print cboFuncList.ListIndex

End Sub

all to no avail
what I'd like is to be able to quickly select item in list and as soon as
let go of mouse, (keyup),
have the value sent to the next sub to put it in a text file.

What me need do?
as always, thanking you'se guys'r'gals who knowses!

mark
0 Likes
Message 4 of 8

Anonymous
Not applicable
also tried

Private Sub Command1_Click()
MsgBox cboFuncList.Value
End Sub

finally something happened! an error! method or data member not found (with
.value highlighted)
thus making me think a combo box didn't have a .value property
also since it doesn't show up in intellitip or property box
but the help file says it is the way to get the selection, I just cant' get
it to work

I must be naturally computer deficient! 😞
0 Likes
Message 5 of 8

Anonymous
Not applicable
finally!

Private Sub Command1_Click()
MsgBox cboFuncList.List(cboFuncList.ListIndex)
End Sub
0 Likes
Message 6 of 8

Anonymous
Not applicable
Or you could use the Text property 😉

Jacob

"MP" wrote in message
news:DBF11B46BC83B5D6BA9DAF26FB7E4D41@in.WebX.maYIadrTaRb...
> finally!
>
> Private Sub Command1_Click()
> MsgBox cboFuncList.List(cboFuncList.ListIndex)
> End Sub
>
>
>
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
brain cells must be low on caffeine, none of these simple obvious things
seemed to work when I tried them...i knew it had to be easy. 🙂
hey, hows caly? seeing yer addy makes me remember how much I miss the coast!

Jacob Dinardi wrote in message
news:59F3C276D737C310BAD2078FA03B0725@in.WebX.maYIadrTaRb...
> Or you could use the Text property 😉
>
> Jacob
0 Likes
Message 8 of 8

Anonymous
Not applicable
it's always nice out this way... a little warm right now, waiting for the
snow...

"MP" wrote in message
news:83412A9DDCE4B39EF056787CBFA79F09@in.WebX.maYIadrTaRb...
> brain cells must be low on caffeine, none of these simple obvious things
> seemed to work when I tried them...i knew it had to be easy. 🙂
> hey, hows caly? seeing yer addy makes me remember how much I miss the
coast!
>
> Jacob Dinardi wrote in message
> news:59F3C276D737C310BAD2078FA03B0725@in.WebX.maYIadrTaRb...
> > Or you could use the Text property 😉
> >
> > Jacob
>
>
>
0 Likes