1 Replies - 629 Views - Last Post: 26 July 2012 - 08:21 AM Rate Topic: -----

#1 katie1988  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 17-July 12

Is it possible to grey out data on ListView in VB6?

Posted 26 July 2012 - 04:00 AM

I'm creating a program that has a search facility. It works fine. If I enter an item in the search box it displays that item, if I leave it blank it displays al items etc. My question is if I were to search for a particular product, would it be possible for the ListView to display the item at the top of the list and all other items after and greyed out if possible? I need all data so it can be copied to an external file.

This is my code at the moment. As I said it works fine but would it be possible as I need all items in the listview so my program can run properly. Thanks

 Dim desc As String
 Dim barcode As String
 Dim quantity As String
 Dim dept As String

 Dim listitm As ListItem
 Dim itm As ListItem
 Dim SearchStr As String
 Dim SearchChar As String
 Dim colhead As ColumnHeader

 ListView1.ListItems.Clear

 Open "E:\Latest VB\Export.CSV" For Input As #1
 Do Until EOF(1)
 Input #1, desc, barcode, quantity, dept
 If InStr(1, LCase(desc), txtProduct.Text, vbTextCompare) Then
 With ListView1
    .View = lvwReport
    .FullRowSelect = True
 Set itm = .FindItem(txtProduct.Text, lvwText, , lvwPartial)
 Set listitm = .ListItems.Add(, , desc)
 listitm.SubItems(1) = (barcode)
 listitm.SubItems(2) = (quantity)
 listitm.SubItems(3) = (dept)
 End With
 End If
 Loop
 Close #1
 End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to grey out data on ListView in VB6?

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Is it possible to grey out data on ListView in VB6?

Posted 26 July 2012 - 08:21 AM

Here we are. Had to do a bit of digging around, but there's a "Ghosted" property that should do what you want. Check this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1