Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LOL
#9
WTF, I have no memory of adding this xD WEIRD

Add a textbox called: txtSearch
Code:
Private Sub txtSearch_Change()
Dim i As Long
  If InItemsEditor = True Then

    For i = 1 To MAX_ITEMS
      If InStr(1, LCase(Item(i).Name), txtSearch.Text) > 0 Then
        lstIndex.ListIndex = i - 1
        Exit For
      End If
    Next i
  End If
  If InNpcEditor = True Then
    For i = 1 To MAX_NPCS
      If InStr(1, LCase(Npc(i).Name), LCase(txtSearch.Text)) > 0 Then
        lstIndex.ListIndex = i - 1
        Exit For
      End If
    Next i
  End If
  If InShopEditor = True Then
    For i = 1 To MAX_SHOPS
      If InStr(1, LCase(Shop(i).Name), LCase(txtSearch.Text)) > -1 Then
        lstIndex.ListIndex = i - 1
        Exit For
      End If
    Next i
  End If
  If InSpellEditor = True Then
    For i = 1 To MAX_SPELLS
      If InStr(1, LCase(Spell(i).Name), LCase(txtSearch.Text)) > 0 Then
        lstIndex.ListIndex = i - 1
        Exit For
      End If
    Next i
  End If
  If InArrowEditor = True Then
    For i = 1 To MAX_ARROWS
      If InStr(1, LCase(Arrows(i).Name), LCase(txtSearch.Text)) > 0 Then
        lstIndex.ListIndex = i - 1
        Exit For
      End If
    Next i
  End If
End Sub

Private Sub txtSearch_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then Call cmdOk_Click '13=enter key
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)