|
-
Oct 18th, 2000, 08:47 PM
#1
Thread Starter
Lively Member
here is my code how do i add data to these columnsplease help me!!
Code:
Private Sub Form_Load()
'creat obj var for columnHeader obj and listitem obj
Dim sColumn As ColumnHeader
Dim sitem As ListItem
'start in report view
listview1.View = lvwReport
'set the size and pos of the listview
listview1.Width = ScaleWidth
listview1.Height = ScaleHeight
listview1.Top = ScaleTop
listview1.Left = ScaleLeft
'add columnHeaders..the width of the columns is
'the widht of the ctrl / 2 by the num of headers
Set sColumn = listview1.ColumnHeaders.Add(, , "Name")
Set sColumn = listview1.ColumnHeaders.Add(, , "Phone #1")
Set sColumn = listview1.ColumnHeaders.Add(, , "Phone #2")
End Sub
-
Oct 18th, 2000, 09:05 PM
#2
Try this,
Code:
Private Sub Form_Load()
'creat obj var for columnHeader obj and listitem obj
Dim sColumn As ColumnHeader
Dim sitem As ListItem
'start in report view
ListView1.View = lvwReport
'set the size and pos of the listview
ListView1.Width = ScaleWidth
ListView1.Height = ScaleHeight
ListView1.Top = ScaleTop
ListView1.Left = ScaleLeft
'add columnHeaders..the width of the columns is
'the widht of the ctrl / 2 by the num of headers
Set sColumn = ListView1.ColumnHeaders.Add(, , "Name")
Set sColumn = ListView1.ColumnHeaders.Add(, , "Phone #1")
Set sColumn = ListView1.ColumnHeaders.Add(, , "Phone #2")
For i = 1 To 10
ListView1.ListItems.Add , , i
ListView1.ListItems(i).SubItems(1) = Format(Str(Int(Rnd * 100000000)), "0-###-###-####")
ListView1.ListItems(i).SubItems(2) = Format(Str(Int(Rnd * 100000000)), "0-###-###-####")
Next i
End Sub
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Oct 18th, 2000, 09:09 PM
#3
Thread Starter
Lively Member
thanks alot that worked
but if i want to edit that data displayed how would i do that????
-
Oct 18th, 2000, 09:28 PM
#4
Here is how u can edit the Data at Runtime. Or You can click on the item twice(not Double Click) to edit it.
Code:
Private Sub Command1_Click()
ListView1.SelectedItem.Text = "New Name"
ListView1.SelectedItem.ListSubItems(1) = "New Phone No1"
ListView1.SelectedItem.ListSubItems(2) = "New Phone No2"
End Sub
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|