|
-
Jun 26th, 2008, 11:18 AM
#1
Thread Starter
Banned
listview help
HOW CAN I LOAD txt FILE IN listview?
-
Jun 26th, 2008, 11:54 AM
#2
Lively Member
Re: listview help
this code will give you a start. how about using richtextbox instead of listview?
Code:
strFileName = "C:\folder\File.txt"
intFile = FreeFile
Open strFileName For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, strLineText
ListView1.ListItems.Add 1, , strLineText
Loop
Close #intFile
-
Jun 26th, 2008, 11:59 AM
#3
Thread Starter
Banned
Re: listview help
yes its working thanks can u tell me how can i code i can took txt file from anywere jus click on load list and i took txt file from anywere thanks for ur tht code
-
Jun 26th, 2008, 01:02 PM
#4
Lively Member
Re: listview help
add component to your project :
Project
Components
on Controls tab look for Microsoft Common Dialog Control 6.0
double click Commondialog Control from the toolbox
Code:
Private Sub cmdLoadList_Click()
Dim strFileName,strLineText As String
CDialog.ShowOpen
strFileName = CDialog.FileName
If len(CDialog.FileName) < 1 Then
MsgBox ("Select file from the list")
Else
intFile = FreeFile
Open strFileName For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, strLineText
ListView1.ListItems.Add 1, , strLineText
Loop
Close #intFile
End If
End Sub
Last edited by nubie; Jun 26th, 2008 at 01:05 PM.
-
Jun 26th, 2008, 01:06 PM
#5
Thread Starter
Banned
Re: listview help
thanks its working 101 % ur realy good programmer thanks you and one kiss for u :-*
-
Jun 26th, 2008, 01:10 PM
#6
Re: listview help
Now that you have been helped, you could help us out. If you consider your question to be resolved please pull down the Thread Tools menu and click the Mark Thread Resolved menu item. That will let everyone know that you have your answer.
Thank you.
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
|