|
-
May 31st, 2000, 05:03 AM
#1
Thread Starter
Frenzied Member
I want to make a list, and when you click on one of the items, it will give you an explanation. How do I make this save as one file instead of each having its own file?
-
May 31st, 2000, 05:16 AM
#2
Hyperactive Member
Is this something where you could use the resource file editor to store the descriptions? Then when the user clicks the item, load the string that is associated with it into a messagebox or balloon help or whatever?
-
May 31st, 2000, 05:20 AM
#3
You need two lists.
One for the items and one the comments.
Code:
Public Sub List_Load(TheList As ListBox, FileName As String)
'// Loads a file to a list box
On Error Resume Next
Dim TheContents As String
Dim fFile As Integer
fFile = FreeFile
Open FileName For Input As fFile
Do
Line Input #fFile, TheContents$
Call List_Add(TheList, TheContents$)
Loop Until EOF(fFile)
Close fFile
End Sub
Public Sub List_Save(TheList As ListBox, FileName As String)
'// Save a listbox as FileName
On Error Resume Next
Dim Save As Long
Dim fFile As Integer
fFile = FreeFile
Open FileName For Output As fFile
For Save = 0 To TheList.ListCount - 1
Print #fFile, TheList.List(Save)
Next Save
Close fFile
End Sub
In the lists:
List1:
On Error Resume Next
List2.ListIndex = List1.ListIndex
'You could also make some text popup telling you:
'Msgbox list2
'Or something like that
Hope you understand.
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
|