I have a combo box on a form. It is fairly narrow box, and frquently not all
of the text of a particular entry is visible. (It shows 15 or so characters,
generally enough for me to figuer out what the entry is, but not always.) I
cannot widen the box. (at least from a practical point of view).

When I move my cursor up and down the list of entries (without clicking
anything) the entry over which the cursor is hovering turns 'blue.' That
suggests that Word (VBA) 'knows' where it is (even without a mouse click). I
don't want to click anything at this point. I just want to hover and have
VBA help me to decide if that is the proper item, and if not, to the cursor
move up or down to the next item.

How can I capture that value (without clicking anything) and show it as a
controltiptext so that I can see the entire value of the entry? (I tried
playing with 'CurLine', but that doesn't work for lists, only textboxes).
Seems this should be easy, but I have been playing with this for hours with
0 success. I hope this group can help. Thanks.

Ed

Re: Getting value in dropdown list while 'hovering' by Vince

Vince
Thu May 26 05:22:39 CDT 2005


"Ed" <let2editor@aol.com> wrote in message
news:R9gle.4367$%Z2.677@lakeread08...
>I have a combo box on a form. It is fairly narrow box, and frquently not
>all
> of the text of a particular entry is visible. (It shows 15 or so
> characters,
> generally enough for me to figuer out what the entry is, but not always.)
> I
> cannot widen the box. (at least from a practical point of view).
>
> When I move my cursor up and down the list of entries (without clicking
> anything) the entry over which the cursor is hovering turns 'blue.' That
> suggests that Word (VBA) 'knows' where it is (even without a mouse click).
> I
> don't want to click anything at this point. I just want to hover and have
> VBA help me to decide if that is the proper item, and if not, to the
> cursor
> move up or down to the next item.


There is a hover property or something similar in VB that does that but I
can't seem to produce the same effect in VBA. I can't find the property
(Word 2000). Anyway, from my VB knowledge, provided the thing turns blue,
all you need to do is a:

for i=0 to list1.listitems.count-1
if list1(i).selected=true then
list1.tooltiptext="Selected " & list1(i)
end if
next

Whenever you see the blue thing, the list item has already been selected.

I am not a 100% sure about any of this but I guess this should do it....

>
> How can I capture that value (without clicking anything) and show it as a
> controltiptext so that I can see the entire value of the entry? (I tried
> playing with 'CurLine', but that doesn't work for lists, only textboxes).
> Seems this should be easy, but I have been playing with this for hours
> with
> 0 success. I hope this group can help. Thanks.
>
> Ed
>
>



Re: Getting value in dropdown list while 'hovering' by Ed

Ed
Thu May 26 07:16:16 CDT 2005

>There is a hover property or something similar in VB
>that does that but I can't seem to produce the same
>effect in VBA. I can't find the property
>(Word 2000). Anyway, from my VB knowledge,
>provided the thing turns blue, all you need to do is a:

>for i=0 to list1.listitems.count-1
> if list1(i).selected=true then
> list1.tooltiptext="Selected " & list1(i)
> end if
>next

>Whenever you see the blue thing, the list item has
>already been selected.

Vince,

Unfortunately (for me) a combobox does not allow the "Selected" method
(or is it a property). Regardless, it zoos out when I try the code, or
anything like it. I'll keep looking. Thanks anyway.

Ed



Re: Getting value in dropdown list while 'hovering' by Vince

Vince
Thu May 26 09:42:20 CDT 2005



Oops, I am sorry! I read Listbox!!! I am not sure why my eyes changed "Combo"
to "List!"

On 26/05/2005 "Ed" <let2editor@aol.com> wrote:
>>There is a hover property or something similar in VB
>>that does that but I can't seem to produce the same
>>effect in VBA. I can't find the property
>>(Word 2000). Anyway, from my VB knowledge,
>>provided the thing turns blue, all you need to do is a:
>
>>for i=0 to list1.listitems.count-1
>> if list1(i).selected=true then
>> list1.tooltiptext="Selected " & list1(i)
>> end if
>>next
>
>>Whenever you see the blue thing, the list item has
>>already been selected.
>
>Vince,
>
> Unfortunately (for me) a combobox does not allow the "Selected" method
>(or is it a property). Regardless, it zoos out when I try the code, or
>anything like it. I'll keep looking. Thanks anyway.
>
>Ed
>
>


RE: Getting value in dropdown list while 'hovering' by RoyL

RoyL
Fri May 27 04:31:03 CDT 2005

Just wanted to let everyone know that this discussion is still 'open' and any
suggestions will be gratefully accepted. -Ed

Re: Getting value in dropdown list while 'hovering' by David

David
Fri May 27 23:15:58 CDT 2005

This was the only thing I could make work. Well sort of... ;P

Private Sub ComboBox1_Change()
A = ComboBox1.ListIndex

Select Case A
Case 0
ComboBox1.ControlTipText = "Choosing 1 will give you Option A"

Case 1
ComboBox1.ControlTipText = "Choosing 2 will give you Option B"

Case 2
ComboBox1.ControlTipText = "Choosing 3 will give you Option C"

Case 3
ComboBox1.ControlTipText = "Choosing 4 will give you Option D"

Case 4
ComboBox1.ControlTipText = "Choosing 5 will give you Option E"

Case 5
ComboBox1.ControlTipText = "Choosing 6 will give you Option F"

End Select

End Sub

But this only works AFTER you click the selection, which is what you
didn't want. Also, you have to move the pointer off the combobox and
then back over before the control tip would display.

Another option would be to do just that, add another option. Add a Help
item in your list that would always stay at the top of the list for you
to select. That selection would bring up another userform that has a
widescreen version of your list.


RE: Getting value in dropdown list while 'hovering' by NoDakDame

NoDakDame
Thu Jun 02 15:58:02 CDT 2005

Hi Ed,

I played with some programming options and then I found the simplest answer
of all. The width of the box does not limit the width of the drop down list.
I created a combo box that where the width was 54 but I changed the value for
the ListWidth property to 144. When the form runs, the combo box is quite
narrow but when you click the down arrow, the list is much wider and I can
see all of my entries in their entirety. Give it a try and hopefully this
does what you need.

Kathy

"Ed" wrote:

> I have a combo box on a form. It is fairly narrow box, and frquently not all
> of the text of a particular entry is visible. (It shows 15 or so characters,
> generally enough for me to figuer out what the entry is, but not always.) I
> cannot widen the box. (at least from a practical point of view).
>
> When I move my cursor up and down the list of entries (without clicking
> anything) the entry over which the cursor is hovering turns 'blue.' That
> suggests that Word (VBA) 'knows' where it is (even without a mouse click). I
> don't want to click anything at this point. I just want to hover and have
> VBA help me to decide if that is the proper item, and if not, to the cursor
> move up or down to the next item.
>
> How can I capture that value (without clicking anything) and show it as a
> controltiptext so that I can see the entire value of the entry? (I tried
> playing with 'CurLine', but that doesn't work for lists, only textboxes).
> Seems this should be easy, but I have been playing with this for hours with
> 0 success. I hope this group can help. Thanks.
>
> Ed
>
>
>