|
-
Nov 19th, 2000, 04:58 PM
#1
Thread Starter
New Member
If I have a listbox, with the checkbox option, how do I print out all the checked items?
/Nisse
-
Nov 19th, 2000, 05:27 PM
#2
_______
<?>
Code:
Option Explicit
Private Sub Form_Load()
'load a listbox with a few items and check two items
Dim i As Integer
For i = 0 To 9
List1.AddItem i + 1
If i = 4 Or i = 6 Then
List1.Selected(i) = True
End If
Next i
'find the checked items and print them
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
If List1.Selected(i) = True Then
Printer.Print List1.ListIndex
End If
Next
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 19th, 2000, 06:24 PM
#3

Code:
Private Sub Command1_Click()
On Error Resume Next
Dim i As Integer
With List1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Printer.Print i
End If
Next
End With
End Sub
..And I see you have this part Wayne, well, it was purdy hard to notice. Just pointing it out... 
[Edited by Matthew Gates on 11-19-2000 at 06:27 PM]
-
Nov 20th, 2000, 02:46 AM
#4
Should it be Printer.Print .List(i) ?
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
|