|
-
Feb 18th, 2002, 01:33 AM
#1
Thread Starter
Addicted Member
HeLp!!
i have an notepad files, i want to make a listbox and add the notepad files there and that when you click on one it will show the text in a text box how can i do that?
-
Feb 18th, 2002, 01:53 AM
#2
throw a rtf text box onto the form, on the click event of the list box parse the file and gooi it into the rtf box.
i'll leave the parsing code to u
-
Feb 23rd, 2002, 06:47 PM
#3
Thread Starter
Addicted Member
i dont know what u mean could someone help me?
-
Feb 23rd, 2002, 07:50 PM
#4
Try this.
VB Code:
Private m_FilePath As String
Private Sub LoadFilesInListBox(sDir As String)
Dim sFile As String
If Right$(sDir, 1) <> "\" Then sDir = sDir & "\"
m_FilePath = sDir
sFile = Dir$(sDir & "*.*")
Do While Len(sFile) > 0
If UCase$(Right$(sFile, "3")) = "TXT" Then List1.AddItem sFile
sFile = Dir
Loop
End Sub
Private Sub Command1_Click()
LoadFilesInListBox "C:\windows"
End Sub
Private Sub List1_DblClick()
Open m_FilePath & "\" & List1.List(List1.ListIndex) For Input As #1
Text1 = Input(LOF(1), 1)
Close #1
End Sub
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
|