Results 1 to 8 of 8

Thread: Syntax

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Syntax

    This was posted by Serge on how to autocomplete a combobox.

    what is the &gt?

    When I put this code in my app, the line is red.

    VB Code:
    1. Private Declare Function SendMessageStr Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2. Private Const CB_FINDSTRING = &H14C
    3.  
    4.  
    5. Private Sub Combo1_Change()
    6.     Dim lRetIndex As Long
    7.    
    8.     lRetIndex = SendMessageStr(Combo1.hwnd, CB_FINDSTRING, -1, ByVal Combo1.Text)
    9.     If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex
    10. End Sub

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Syntax

    Originally posted by vbgladiator
    This was posted by Serge on how to autocomplete a combobox.

    what is the &gt?

    When I put this code in my app, the line is red.

    VB Code:
    1. Private Declare Function SendMessageStr Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2. Private Const CB_FINDSTRING = &H14C
    3.  
    4.  
    5. Private Sub Combo1_Change()
    6.     Dim lRetIndex As Long
    7.    
    8.     lRetIndex = SendMessageStr(Combo1.hwnd, CB_FINDSTRING, -1, ByVal Combo1.Text)
    9.     If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex
    10. End Sub
    If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex

    > is the HTML code for >
    did you replace > with > ?

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    huh? That didnt make much sense man.

    &gt; <- that is a problem though. Is that the > you are talking
    about?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Originally posted by vbgladitor
    what is the >?
    What is the what?

    This is a routine I put together for auto complete, and I've had no problems with it.
    VB Code:
    1. 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
    2.  
    3. Private Const CB_ERR = (-1)
    4. Private Const CB_FINDSTRING = &H14C
    5.  
    6. Private Sub FindMatch(CB As ComboBox, KeyAscii As Integer)
    7.  
    8.             On Error Resume Next
    9.             Dim MyBuffer As String
    10.             Dim FindIt As Long
    11.             MyBuffer = Left(CB.Text, CB.SelStart) & Chr(KeyAscii)
    12.             FindIt = SendMessage((CB.hwnd), CB_FINDSTRING, -1, ByVal MyBuffer)
    13.                 If FindIt <> CB_ERR Then
    14.                    CB.ListIndex = FindIt
    15.                    CB.Text = CB.List(FindIt)
    16.                    CB.SelStart = Len(MyBuffer)
    17.                    CB.SelLength = Len(CB.Text)
    18.                    KeyAscii = 0
    19.             End If
    20.  
    21. End Sub
    22.  
    23. Private Sub Combo1_KeyPress(KeyAscii As Integer)
    24. FindMatch Combo1, KeyAscii
    25. End Sub

  5. #5

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Oh, OK.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by vbgladiator
    No, I was referring to the actual

    If lRetIndex &gt;= 0 Then Combo1.ListIndex = lRetIndex

    Ampersand gt
    so then we answered your question?

    BTW hacks code works great.. i use it in one of my apps..

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Oh...

    It looks like a type to me....

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    sometimes when you copy/paste code from an HTML page.. it sees certain characters as the HTML equivelent... so > showed up as &gt; when you pasted it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width