Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:24:57+00:00 2026-05-28T06:24:57+00:00

I have Questions? If I enter a data in a textbox, I want my

  • 0

I have Questions?
If I enter a data in a textbox,
I want my listview to select the same data entered in the textbox,

example,
I have a StudentNumber column in my listview and it has data on it(ex. 123456)
I will enter 123456 in the textbox.
The ListView must select 123456 ?
Please Help

THANK YOU,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:24:58+00:00Added an answer on May 28, 2026 at 6:24 am

    I think this will do what you want. It will search the first column of the ListView for the text in the TextBox.

    Setup the listview:

    With ListView1
        .MultiSelect = False 'Ensure only one item selected at a time
        .HideSelection = False 'Shows the selection when the textbox changes
        'Add some items for testing
        .Items.Add("1234")
        .Items.Add("1122")
        .Items.Add("1133")
    End With
    

    Then in the textbox TextChanged changed event:

    Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
        ListView1.SelectedItems.Clear()
        Dim foundItem As ListViewItem = ListView1.FindItemWithText(TextBox1.Text, False, 0, False)
        If (foundItem IsNot Nothing) Then foundItem.Selected = True
    End Sub
    

    Alternatively if you want to specify which column of your ListView to search for the text then this function should do the trick:

    Private Sub SelectListViewItem(ByRef listviewSource As ListView, ByVal textToFind As String, ByVal column As Integer)
        Dim foundItem As ListViewItem = Nothing
        Dim startIndex As Integer = 0
    
        listviewSource.SelectedItems.Clear()
    
        Do Until Not foundItem Is Nothing AndAlso foundItem.SubItems(column).Text = TextBox2.Text
            If foundItem Is Nothing Then startIndex = 0 Else startIndex = foundItem.Index + 1
            If startIndex > listviewSource.Items.Count - 1 Then Exit Sub 'We have reached end of the listview
            foundItem = listviewSource.FindItemWithText(textToFind, True, startIndex)
            If foundItem Is Nothing Then Exit Sub
        Loop
    
        If (foundItem IsNot Nothing) Then foundItem.Selected = True
    End Sub
    

    Usage:

    Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged
    
        SelectListViewItem(ListView1, TextBox2.Text, 1)
    End Sub
    

    Warning – In both cases, this may cause your application to perform poorly if you have a lot of items in your listview, in that case you could consider moving the code into a background worker

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create some simple navigation in sencha touch 2. I have questions
I have 2 questions on kendo combobox change event. On change event I want
We have a custom WPF control with multiple TextBox . Each TextBox has its
I have a Symfony 1.4 application to allow users to enter data to a
problem is existing applications on our organization required to enter same data multiple times,
i have an asp.net webform. the users enter data into the textboxes and i
I have questions about System.Threading.ThreadStart Class : where can I find its specifications (
I am going to be making a small user system but I have questions.
have 2 questions : A computer with 32-bit address uses 2-level page table (9
similar questions have been asked before but I cant find an exact match to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.