|
-
Feb 3rd, 2007, 10:35 AM
#1
Thread Starter
Lively Member
[RESOLVED] Saving and loading settings of listbox checkstyle?
Hi, i am wondering how to save and load settings in a listbox with checkbox style. I want to have it so the user can click a button "save setting" and the list is stored and the selected checkboxes for the list are stored, so when the user starts the program again, the click "load setting" and the list and checked boxs are loaded.
Last edited by Hack; Feb 13th, 2007 at 10:57 AM.
Reason: Added [RESOLVED] to thread title and green "resolved" checkmark
-
Feb 3rd, 2007, 09:36 PM
#2
Re: Saving and loading settings of listbox checkstyle?
You would need to write the information to a file.
VB Code:
Private Sub cmdLoadList_Click()
Dim strItem As String
Dim blnChecked As Boolean
Dim fnum As Integer
On Error GoTo ErrHandler
fnum = FreeFile
Open App.Path & "\SavedList.txt" For Input As #fnum
List1.Clear
Do Until EOF(fnum)
Input #fnum, strItem, blnChecked
List1.AddItem strItem
List1.Selected(List1.NewIndex) = blnChecked
Loop
Close #fnum
Exit Sub
ErrHandler:
If Err.Number = 53 Then
MsgBox "No saved list was found."
Else
MsgBox "Unhandle error: " & Err.Number
End If
End Sub
Private Sub cmdSaveList_Click()
Dim fnum As Integer
Dim i As Long
fnum = FreeFile
Open App.Path & "\SavedList.txt" For Output As #fnum
For i = 0 To List1.ListCount - 1
Write #fnum, List1.List(i); List1.Selected(i)
Next i
Close #1
End Sub
-
Feb 12th, 2007, 03:56 PM
#3
Thread Starter
Lively Member
Re: Saving and loading settings of listbox checkstyle?
Thanks that works perfect. Sorry for taking so long, i got my new system! e6300, asus p5b-deluxe, 2x 1gb ocz gold xtc, 7600gt. Got a 16.434 seconds in superpi 1m at 500fsb on stock cooler! temps only hit 57 full load 4 hours.
-
Feb 13th, 2007, 10:56 AM
#4
Re: Saving and loading settings of listbox checkstyle?
If you consider this resolved, would you 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
|