Results 1 to 6 of 6
  1. #1
    metalen666's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    14
    Thanks
    34
    My Mood
    Relaxed

    Textbox searches Listbox and slecets that item ?

    can you show me how to get : a textbox to search a listbox and then select this item ?


    Thanks for help !

    PRESS THANKS

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Loop through the items with a for loop and just check the items text with an if-clause.



  3. #3
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,132
    My Mood
    Dead
    [highlight=vbnet]
    'Replace TextBox1 with your search TextBox
    Dim index As Integer = ListBox1.FindString(TextBox1.Text)
    If Not index < 0 Then
    For x As Integer = 0 To ListBox1.Items.Count - 1
    If (ListBox1.Items(x).ToString.Contains(TextBox1.Text )) Then
    ListBox1.SelectedIndex = x
    Return
    End If
    Next
    End If[/highlight]

  4. #4
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Hassan View Post
    [highlight=vbnet]
    'Replace TextBox1 with your search TextBox
    Dim index As Integer = ListBox1.FindString(TextBox1.Text)
    If Not index < 0 Then
    For x As Integer = 0 To ListBox1.Items.Count - 1
    If (ListBox1.Items(x).ToString.Contains(TextBox1.Text )) Then
    ListBox1.SelectedIndex = x
    Return
    End If
    Next
    End If[/highlight]
    Why calculate the index of it, then manually go and find it again lol.

    [highlight=vb.net]
    Dim index As integer = ListBox1.FindString(TextBox1.Text)
    If index > -1 Then ListBox1.SelectedIndex = index
    [/highlight]

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. The Following 2 Users Say Thank You to Jason For This Useful Post:

    Hassan (10-03-2011),metalen666 (10-05-2011)

  6. #5
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,132
    My Mood
    Dead
    Quote Originally Posted by Jason View Post


    Why calculate the index of it, then manually go and find it again lol.

    [highlight=vb.net]
    Dim index As integer = ListBox1.FindString(TextBox1.Text)
    If index > -1 Then ListBox1.SelectedIndex = index
    [/highlight]
    *Sigh* - I first tried it with loop and then with FindString. Mixed both of them. My bad. Thanks for pointing that out lol.

  7. #6
    metalen666's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    14
    Thanks
    34
    My Mood
    Relaxed
    Quote Originally Posted by Jason View Post


    Why calculate the index of it, then manually go and find it again lol.

    [highlight=vb.net]
    Dim index As integer = ListBox1.FindString(TextBox1.Text)
    If index > -1 Then ListBox1.SelectedIndex = index
    [/highlight]
    ThX. Working fine.

    PRESS THANKS

Similar Threads

  1. Come and see That hacker in mutation mode
    By kokojemy in forum CrossFire Hacks & Cheats
    Replies: 46
    Last Post: 02-20-2010, 05:31 AM
  2. New clan (no elbem but soon) and people that are good
    By twoline in forum Combat Arms Clan Recruitment & Advertising
    Replies: 0
    Last Post: 01-02-2010, 11:17 PM
  3. New weapons and stuff that will come *Not next patch*
    By ineverhack in forum CrossFire Hacks & Cheats
    Replies: 21
    Last Post: 08-31-2009, 04:10 PM
  4. selling lvl 93 with 10m cash and 5m in items
    By masoudmasoud in forum Trade Accounts/Keys/Items
    Replies: 12
    Last Post: 12-17-2007, 06:46 PM
  5. For all who need helps and n00bs that want start to create hack easily
    By idiot123 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 08-20-2007, 11:05 AM