473,881 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to filter a listview that matches only with a keyword?

12 New Member
this is my line of codes. but it only compares to the equal match on the textbox. is there any way where i can match even just a keyword and will select all items with the same keyword that i type on textbox.

[left]
For i = 0 To ListView1.Items .Count - 1
If ListView1.Items (i).SubItems(1) .Text.ToLower = TextBox1.Text.T oLower Then
ListView1.Items (i).Selected = True
ListView1.Ensur eVisible(i)
End If
Next
[/right]

tnx in advance!
Apr 24 '11 #1
1 9744
MrMancunian
569 Recognized Expert Contributor
You could use
Expand|Select|Wrap|Line Numbers
  1. ListView1.Items(i).SubItems(1).Text.ToLower.Contains(Textbox1.Text.ToLower)
to check if the listviewitem contains your string somewhere.

Steven
May 26 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1537
by: Peter Otten | last post by:
I'm sure they have been mentioned somewhere but here are some more advantages of a decorator keyword (I use "transform"): - The docstring can be moved to the top of the decorator suite. - Simple attributes that don't affect the function's operation directly can be written in the "natural" name = value form. - Though I expect them to be rare like they are in classes today, statements like if __debug__: decorateForDebugging would be...
2
12260
by: pcPirate | last post by:
Hi, Just a simple question. In C# i) Is there a way to filter the items in Listview by characters? Say, if the items are: "AA", "AAA", "AB", when I type "AA", the listview should display only the: "AA" and "AAA". Pls advise. Thanks in advance. pcPirate
1
4817
by: Shaker | last post by:
I was asked recently why the VB.NET With Keyword was not implented in C#, and I couldn't think of an answer. Does anybody have any ideas? Thanks, Andrew Niemann '04, MCP
5
8503
by: Mystilleef | last post by:
Hello, Is there a simple flag to set to allow overlapping matches for the findall() regular expression method? In other words, if a string contains five occurrences of the string pattern "cat", calling findall on the string returns a list containing five "cat" strings. Is it possible for findall() to just return one "cat" string? Thanks
10
1590
by: Timothy V | last post by:
Hi, Is there a C# equivelant to VB's with keyword? Thanks, Tim.
1
2535
by: =?Utf-8?B?R3VzIENodWNo?= | last post by:
How can I populate a ListView Box with the current directory, filename, file length, date created and date last modified? I can get the current directory and length by using Dim Path As String = System.IO.Directory.GetCurrentDirectory() With Me.ListViewBox1 Item = New ListViewItem(Path) Item.SubItems.Add(Path.Lenght) ..Items.Add(Item)
8
1687
by: matthewperpick | last post by:
Check out this toy example that demonstrates some "strange" behaviour with keyword arguments and inheritance. ================================= class Parent: def __init__(self, ary = ): self.ary = ary def append(self):
4
3725
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
I have a winforms application that is supposed to look into a specific directory, popluate a ListView control with the contents of the directory. I am new to this, and have not found the exact thing. How do I populate the ListView with a given path?
7
2297
nev
by: nev | last post by:
i declared 2 datatables: dim dtt1 as datatable = ds.datatable1 dim dtt2 as datatable = ds.datatable2 dtt1 has firstname, lastname columns dtt2 has firstname column when i filter dtt1 by lastname, there will be a lot of firstnames
1
7041
by: =?Utf-8?B?WVhR?= | last post by:
When double-click the listview item with checkbox (View = Details), the checkbox will be checked or unchecked, how to disable this behavior? thank you.
0
9775
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11094
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10396
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9550
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7952
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3221
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.