Hi,
I have a text file (textNum.txt)having numbers from 1 to 100 (1,2,3,4......100)
and I have another text file (textName.txt) that contains names for the numbers (one,two,three,four....one hundred)
what I need to do is to display the content of both files in a listbox having two or more columns..
Any help would be greatly appriciated
Last edited by merhaba; Jun 8th, 2006 at 03:15 PM.
Actually there is a "columns" in listbox properties window.
and..
I cant see any "list-view" in my toolbox ....then I right clicked to add one..but there is none in the component section either...
ok.. but columns is for a horizontal scroll bar setup.. so... its ONE list but shows 2 columns at a time
Like in explorer - view Lists (instead of Icon, Details.. etc)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Okay, thanks
I managed to add all those controlers in the toolbox..
But,I added the "mkcHyperLinks" to the listbox, then I noticed that it is not there ? what should I do to make it stay there all the time?
I used "mkcHyperLinks" to give a link to text file in one of my recent projects..
I did not mean it for this thread....
As for this thread I get an error message saying "file already open" ???
MyListView was just an assumed listview control name. I updated it to the default ListView1, since you said in post#14 that your using that control name.
Last edited by leinad31; Jun 7th, 2006 at 02:10 PM.
i was just correcting the object in that line - i don't really use the listview, so i wasn't trying to ammend that bit.
I just got lost on the flow of the discussion I thought someone made a suggestion to use a single column instead... if so an additional comma would have been all that was needed in that line.
people usually create the columns at design time... Since your not familiar with listview and that will take some explanation then we will create the columns (ColumnHeaders collection) at run time instead.
VB Code:
Private Sub Command1_Click()
Dim fileA As String
Dim fileB As String
Dim lstNew As ListItem
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "Column 1"
ListView1.ColumnHeaders.Add , , "Column 2"
ListView1.ListItems.Clear
Open "c:\filenum.txt" For Input As #1
Open "c:\filename.txt" For Input As #2
Do While Not EOF(1)
Line Input #1, fileA
Line Input #2, fileB
Set lstNew = ListView1.ListItems.Add(, , fileA) 'first column
Hey, it works...
But I can see only the numbers broken in two rows
1,2,3,4
5,6
I think I need the name of that number, too
as:
1 one
2 two
3 three
........
20 twenty
what is missing ?
what about reading all the text in the "textNum.txt" file
and give it a for loop
and do the same for the "textName.txt" file
dim nums as string
dim sname as string
for nums 1 to 100
for sname 1 to 100
list1.additems nums,snames
next
next
it would be very nice if we can modify the textfile...
50 items in each columns in the text file so that I can have all datas on a single paper
when printed...
Its easiest to alternate between the two column groups (1 group is 2 columns) rather than printing 1-50 in first column group then 50-100 in the second column group.
.I think I need more than two columns
to divide all 300 items by 6 so that each columns display 50 items...
how should I limit the number of items equally for each column?
..I have only two columns in notepad when I run the code above
Thanks
Last edited by merhaba; Jun 8th, 2006 at 03:14 PM.