Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
RattleSnake - Duplicate Listview Item Remover
Author:
RattleSnake
Submitted:
10/7/2005
Version:
VB6
Compatibility:
VB6
Category:
Miscellaneous
Views:
12258
This code snippet is to remove or kill duplicates in vb6 listview. I searched all over the internet to find this code with no results so here it is !
Declarations:
'none
Code:
Public Sub ListViewKillDupes() Dim Search1 As Long Dim Search2 As Long Dim KillDupe As Long KillDupe = 0 For Search1& = 1 To ListView1.ListItems.Count - 1 For Search2& = Search1& + 1 To ListView1.ListItems.Count - 1 KillDupe = KillDupe + 1 If ListView1.ListItems.Item(Search1&) = ListView1.ListItems.Item(Search2&) Then ListView1.ListItems.Remove (Search2&) Search2& = Search2& - 1 End If Next Search2& Next Search1& End Sub ' call it like this: 'Private Sub Command1_Click() 'ListViewKillDupes 'End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement