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
Preventing listview duplicates before adding item
Author:
RattleSnake
Submitted:
10/30/2005
Version:
VB6
Compatibility:
VB6
Category:
Controls
Views:
18683
This code is not a duplicate remover for listview as the other code i submitted. It prevents you from adding duplicates into listview !!
Declarations:
'none
Code:
'By RattleSnake '1: Add a textbox to your form '2:Add a button to your form '2:Add the component Microsoft Windows common controls Private Sub Form_Load() ListView1.ListItems.Add , , "blah1" ListView1.ListItems.Add , , "blah2" ListView1.ListItems.Add , , "blah3" ListView1.ListItems.Add , , "blah4" ListView1.ListItems.Add , , "blah5" End Sub Private Sub Command1_Click() On Error Resume Next With ListView1 If ListView1.FindItem(Text1.Text) <> Text1.Text Then .ListItems.Add , , Text1.Text End With End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement