Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tell me the Difference
Message
 
To
27/03/2000 05:24:54
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00350330
Message ID:
00350664
Views:
29
>Hi,
>
> In my project i am useing ListView in that i want to add
>header as well as columns I have tried it by changing the
>property of ListView also I have tried the MSDN code then
>also at run time it dosen't show the header or columns.
>Also can i add images for each row in ListView if yes
>then how ? ?

For column headers:
Private Sub Form_Load()          
Dim itm As ListItem
   With ListView1              
      .View = lvwReport
      .ColumnHeaders.Add , , "Last Name", .Width / 3
      .ColumnHeaders.Add , , "First Name", .Width / 3
      Set itm = .ListItems.Add(, "Doe", "Doe")
      itm.SubItems(1) = "John"          
   End With      
End Sub
For images:
Dim i As Integer   
   ListView1.Arrange = lvwAutoLeft
   ImageList1.ListImages.Add , , LoadPicture("c:\windows\cars.bmp")
   Set ListView1.Icons = ImageList1   
   Set ListView1.SmallIcons = ImageList1
   For i = 1 To 20       
     ListView1.ListItems.Add , , "Item" & i, 1, 1   
   Next
   ListView1.BorderStyle = 0 
Both samples extracted from MSDN support online.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform