|
-
Aug 22nd, 2002, 12:54 PM
#1
Thread Starter
Frenzied Member
Syntax
This was posted by Serge on how to autocomplete a combobox.
what is the >?
When I put this code in my app, the line is red.
VB Code:
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
Private Const CB_FINDSTRING = &H14C
Private Sub Combo1_Change()
Dim lRetIndex As Long
lRetIndex = SendMessageStr(Combo1.hwnd, CB_FINDSTRING, -1, ByVal Combo1.Text)
If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex
End Sub
-
Aug 22nd, 2002, 12:57 PM
#2
Re: Syntax
Originally posted by vbgladiator
This was posted by Serge on how to autocomplete a combobox.
what is the >?
When I put this code in my app, the line is red.
VB Code:
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
Private Const CB_FINDSTRING = &H14C
Private Sub Combo1_Change()
Dim lRetIndex As Long
lRetIndex = SendMessageStr(Combo1.hwnd, CB_FINDSTRING, -1, ByVal Combo1.Text)
If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex
End Sub
If lRetIndex >= 0 Then Combo1.ListIndex = lRetIndex
> is the HTML code for >
did you replace > with > ?
-
Aug 22nd, 2002, 12:58 PM
#3
huh? That didnt make much sense man.
> <- that is a problem though. Is that the > you are talking
about?
-
Aug 22nd, 2002, 01:03 PM
#4
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:
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_ERR = (-1)
Private Const CB_FINDSTRING = &H14C
Private Sub FindMatch(CB As ComboBox, KeyAscii As Integer)
On Error Resume Next
Dim MyBuffer As String
Dim FindIt As Long
MyBuffer = Left(CB.Text, CB.SelStart) & Chr(KeyAscii)
FindIt = SendMessage((CB.hwnd), CB_FINDSTRING, -1, ByVal MyBuffer)
If FindIt <> CB_ERR Then
CB.ListIndex = FindIt
CB.Text = CB.List(FindIt)
CB.SelStart = Len(MyBuffer)
CB.SelLength = Len(CB.Text)
KeyAscii = 0
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
FindMatch Combo1, KeyAscii
End Sub
-
Aug 22nd, 2002, 01:05 PM
#5
Thread Starter
Frenzied Member
-
Aug 22nd, 2002, 01:06 PM
#6
Originally posted by vbgladiator
No, I was referring to the actual
If lRetIndex >= 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..
-
Aug 22nd, 2002, 01:06 PM
#7
Oh...
It looks like a type to me....
-
Aug 22nd, 2002, 01:08 PM
#8
sometimes when you copy/paste code from an HTML page.. it sees certain characters as the HTML equivelent... so > showed up as > 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|