|
-
Jun 9th, 2000, 02:12 AM
#1
Thread Starter
New Member
I have a List Box(List1) and in the properties area the Style is set to 1- Checkbox.
The problem is that I have to check certain items in the check box based on a seperate file that looks something like this:
#TRUE#
#FALSE#
#FALSE#
#FALSE#
#FALSE#
#TRUE#
#FALSE#
The thing is that I have to do this in a list box with about 52 items in it. When the program is started I have to read from a .txt file that when veiwed looks like my original post. I have to read through the file and put a check in the list box next to every one that is True.
-
Jun 9th, 2000, 02:19 AM
#2
Try this:
Code:
Dim blnValue as Boolean
Open "MyFile" for Input As #1
Do Until EOF(1)
Input #1, blnValue
List1.AddItem CStr(blnValue)
List1.Selected(List1.NewIndex) = blnValue
Loop
"It's cold gin time again ..."
Check out my website here.
-
Jun 9th, 2000, 02:38 AM
#3
Thread Starter
New Member
That almost worked. My problem is that My list box is already populated before I ever even read in the file. I have to put check marks next to items already in the list box without adding any new items. My list box contains each of the 50 States. Thanks for the help so far, I am one step closer.
-
Jun 9th, 2000, 03:30 AM
#4
As you loop thru a listbox, to check a particular item, do something like this:
Code:
For X = 0 To List1.ListCount - 1
If List1.List(X) = "NJ" Or List1.List(X) = "PA" _
Or (whatever) then
List1.Selected(X) = True
End If
Next
"It's cold gin time again ..."
Check out my website here.
-
Jun 9th, 2000, 06:26 AM
#5
Thread Starter
New Member
Thanks for the help. It worked.
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
|