[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

9/22/2011 8:22:00 PM

I have a narrow ComboBox that widens when I drop it down (API call).
When I release the thumb it closes back to the narrow size as desired.
But the selected text is highlighted and shows only the right portion
of the text.
I cannot figure out how to do a
cbo.SelLength = 0
to get the text to be unselected and thus positioned such that the left
portion of the text shows.
LostFocus is of no uses since I do not want to click elsewhere or set
up a MouseMove on surrounding controls.
Is there a SendMessage for the cbo that I can use in one of the cbo_xxx
subs or do I have to use a Timer?


4 Answers

sirlonzelot

2/19/2011 8:59:00 PM

0

On 18 Feb., 21:50, sirlonzelot <wlon...@web.de> wrote:
> On 17 Feb., 20:14, sirlonzelot <wlon...@web.de> wrote:
>
> > On 16 Feb., 07:10, sirlonzelot <wlon...@web.de> wrote:
>
> > > Hi,
>
> > > searching a complete WWplasticset.
>
> > > send me your offers.
>
> > > thanks
>
> > and up. only a newsetis needed
>
> no one ??

and a last time up ^

Jeff Johnson [MVP: VB]

9/22/2011 8:56:00 PM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:j5g5dn$o5j$1@speranza.aioe.org...

>I have a narrow ComboBox that widens when I drop it down (API call).
> When I release the thumb it closes back to the narrow size as desired.
> But the selected text is highlighted and shows only the right portion of
> the text.
> I cannot figure out how to do a
> cbo.SelLength = 0
> to get the text to be unselected and thus positioned such that the left
> portion of the text shows.
> LostFocus is of no uses since I do not want to click elsewhere or set up a
> MouseMove on surrounding controls.
> Is there a SendMessage for the cbo that I can use in one of the cbo_xxx
> subs or do I have to use a Timer?

Question 1: Do you REALLY need a combo box? I.e., is it vital that the users
be able to type ANY text as well as selecting from a list? I tend to avoid
those types of combos like the plague, preferring dropdown lists.


Henning

9/22/2011 9:47:00 PM

0


"BeeJ" <nospam@spamnot.com> skrev i meddelandet
news:j5g5dn$o5j$1@speranza.aioe.org...
>I have a narrow ComboBox that widens when I drop it down (API call).
> When I release the thumb it closes back to the narrow size as desired.
> But the selected text is highlighted and shows only the right portion of
> the text.
> I cannot figure out how to do a
> cbo.SelLength = 0
> to get the text to be unselected and thus positioned such that the left
> portion of the text shows.
> LostFocus is of no uses since I do not want to click elsewhere or set up a
> MouseMove on surrounding controls.
> Is there a SendMessage for the cbo that I can use in one of the cbo_xxx
> subs or do I have to use a Timer?
>
>

What happens if you also set SelStart = 0?

/Henning


David Youngblood

9/23/2011 12:32:00 PM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:j5g5dn$o5j$1@speranza.aioe.org...
>I have a narrow ComboBox that widens when I drop it down (API call).
> When I release the thumb it closes back to the narrow size as desired.
> But the selected text is highlighted and shows only the right portion of
> the text.
> I cannot figure out how to do a
> cbo.SelLength = 0
> to get the text to be unselected and thus positioned such that the left
> portion of the text shows.
> LostFocus is of no uses since I do not want to click elsewhere or set up a
> MouseMove on surrounding controls.
> Is there a SendMessage for the cbo that I can use in one of the cbo_xxx
> subs or do I have to use a Timer?

You know you have the same issue when the combobox gets focus, if the text
is too long to fit the control. I suspect the only way around it is to
subclass the combobox's *Edit* class and trap and eat the EM_SETSEL
message.The trade off is that the text will no longer be auto-selected.

To get the Edit class hwnd.
hwnd = FindWindowEx(Combo1.hWnd, 0&, "Edit", vbNullString)

David