|
-
Dec 29th, 1999, 04:44 AM
#7
Member
U get an "Run-time Error: 380", cuz the procedure trying to set txtViewTable.SelLength to negative value when it didn't find matched item in the list.
Try this
Private Sub listTables_Click()
txtViewTable.Text = listTables.Text
End Sub
Private Sub txtViewTable_Change()
Dim x As Integer
Dim i As Long
x = Len(txtViewTable.Text)
If x = 0 Then Exit Sub
i = SendMessage(listTables.hWnd, LB_FINDSTRING, -1, ByVal txtViewTable.Text)
If i > -1 Then
listTables.ListIndex = i
Else
x = x - 1
txtViewTable = Mid(txtViewTable, 1, x)
listTables.ListIndex = SendMessage(listTables.hWnd, LB_FINDSTRING, -1, ByVal txtViewTable.Text)
listTables_Click
End If
txtViewTable.SelStart = x
txtViewTable.SelLength = Len(txtViewTable.Text) - x
End Sub
Joon
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
|