jarrod100
asked on
VB 6.0 - WordWheel required
Hello there,
could anyone help me with some VB 6 code
for a wordwheel. eg. I need to be able to check for names in a list, where the highlight will jump to the first matching name in alphabetical order ...
10x
could anyone help me with some VB 6 code
for a wordwheel. eg. I need to be able to check for names in a list, where the highlight will jump to the first matching name in alphabetical order ...
10x
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
10x guys,
both codes seem to work fine:
- Erick37s' code is shorter :)
- runner75's code helps me
understand how the search
is accomplished.
you both deserve 100 points,
however this time Erick37 was
first :)
10x Erick37
both codes seem to work fine:
- Erick37s' code is shorter :)
- runner75's code helps me
understand how the search
is accomplished.
you both deserve 100 points,
however this time Erick37 was
first :)
10x Erick37
Glad to help. Thanks.
for this example create a form:
- and add 1 TextBox (named: s_box) ... search box
- and add 1 ListBox (named: Dictionary) ... where all your names will reside (populate this from a DB)
in your code : General/Declarations paste the following code:
========> cut here <==============
Private Sub s_box_KeyUp(KeyCode As Integer, Shift As Integer)
Dim cntr1 As Integer 'counter 1
Dim cntr2 As Integer 'counter 2
Dim n_str As String 'new string
' perform the search
n_str = s_box.Text
For cntr1 = 0 To Dictionary.ListCount - 1)
If Len(n_str) <= Len(Dictionary.List(cntr1)
If UCase(Left(n_str, Len(n_str))) = _
UCase(Left(Dictionary.List
Len(n_str) <> 0 Then
Dictionary.Selected(cntr1)
cntr1 = Dictionary.ListCount - 1
End If
Else
If cntr1 < Dictionary.ListCount - 1 Then
cntr1 = cntr1 + 1
End If
End If
Next cntr1
End Sub
========> cut here <==============
Hope this helps,
runner75