HowTo make Dropdown combo invisible??? 
Author Message
 HowTo make Dropdown combo invisible???

If i understand you right then .......

For i = 0 To Combo1.ListCount - 1
    If Combo1.List(i) = "YourTextEntry" Then
        Combo1.ListIndex = i
        Exit For
    End If
Next i


Quote:
>I use the sendmessage API to dropdown a combo, then set the text property
>and then retract the combo again. It seems that this is the only way to use
>text to set the combo to the right Listindex? Or does anyone know another
>way to set the listindex to the combox entry which matches a text entry?
>Setting the List(index) property doesn't do the trick I believe.

>Thanks
>--
>Berthil van Beek

> http://www.*-*-*.com/
> http://www.*-*-*.com/



Thu, 04 Oct 2001 03:00:00 GMT  
 HowTo make Dropdown combo invisible???

Quote:
> I use the sendmessage API to dropdown a combo, then set the text property
> and then retract the combo again. It seems that this is the only way to
use
> text to set the combo to the right Listindex? Or does anyone know another
> way to set the listindex to the combox entry which matches a text entry?
> Setting the List(index) property doesn't do the trick I believe.

[cc'd to poster, newsgroups trimmed]

I think you can accomplish what you're after a bit more easily, without the
need of the flicker of the combo box dropping down.  Take a look at this
code, let me know if it does what you're after.

-----------

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
   (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
   lParam As Any) As Long

Private Const CB_FINDSTRING = &H14C

Private Sub Command1_Click()

    Dim sToFind As String

    sToFind = "Demo String" & vbNullChar

    Combo1.ListIndex = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, _
                                   ByVal sToFind) '-1 = Search all

End Sub

-----------

--
Scott Seligman                     The avalanche has already begun,

http://www.scottandmichelle.net/          pebbles to vote.




Thu, 04 Oct 2001 03:00:00 GMT  
 HowTo make Dropdown combo invisible???
I use the sendmessage API to dropdown a combo, then set the text property
and then retract the combo again. It seems that this is the only way to use
text to set the combo to the right Listindex? Or does anyone know another
way to set the listindex to the combox entry which matches a text entry?
Setting the List(index) property doesn't do the trick I believe.

Thanks
--
Berthil van Beek

http://www.geocities.com/siliconvalley/lab/2355
http://software.freepage.de/iconbook



Fri, 05 Oct 2001 03:00:00 GMT  
 HowTo make Dropdown combo invisible???
See http://home.earthlink.net/~butlerbob/vb/controls/findlb.htm
The article discusses (with examples) both finding the entry and setting the
listindex using API calls.
HTH
John


Quote:
>I use the sendmessage API to dropdown a combo, then set the text property
>and then retract the combo again. It seems that this is the only way to use
>text to set the combo to the right Listindex? Or does anyone know another
>way to set the listindex to the combox entry which matches a text entry?
>Setting the List(index) property doesn't do the trick I believe.

>Thanks
>--
>Berthil van Beek

>http://www.geocities.com/siliconvalley/lab/2355
>http://software.freepage.de/iconbook



Fri, 05 Oct 2001 03:00:00 GMT  
 HowTo make Dropdown combo invisible???
Better yet use the message, CB_SELECTSTRING = &H14D.  This will select a
match if it exists.
Quote:

>> I use the sendmessage API to dropdown a combo, then set the text property
>> and then retract the combo again. It seems that this is the only way to
>use
>> text to set the combo to the right Listindex? Or does anyone know another
>> way to set the listindex to the combox entry which matches a text entry?
>> Setting the List(index) property doesn't do the trick I believe.

>[cc'd to poster, newsgroups trimmed]

>I think you can accomplish what you're after a bit more easily, without the
>need of the flicker of the combo box dropping down.  Take a look at this
>code, let me know if it does what you're after.

>-----------

>Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
>   (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
>   lParam As Any) As Long

>Private Const CB_FINDSTRING = &H14C

>Private Sub Command1_Click()

>    Dim sToFind As String

>    sToFind = "Demo String" & vbNullChar

>    Combo1.ListIndex = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, _
>                                   ByVal sToFind) '-1 = Search all

>End Sub

>-----------

>--
>Scott Seligman                     The avalanche has already begun,

>http://www.scottandmichelle.net/          pebbles to vote.





Tue, 09 Oct 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. HowTo make Dropdown combo invisible???

2. Making the Form invisible but making the controls seen

3. dropdown combo, multi column (like access..combo)

4. dropdown combo, multi column (like access..combo)

5. Making a control invisible depending on calculated value in Access'97

6. Making calendar invisible

7. making toolbars invisible !

8. Making a Control invisible !

9. Making a Control invisible !

10. Making a Non-UI (or Invisible at runtime) control

11. making a container contol invisible..

12. Help!!! Making cursor invisible

 

 
Powered by phpBB® Forum Software