Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print listbox?????

Status
Not open for further replies.

beck

Programmer
Mar 22, 1999
26
0
0
US
I have created a listbox which accepts calculations from a loop. What I am trying to do is print the entire contents of the listbox on my printer but cannot seem to find a way to do it. The contents of the listbox is the result of performing various calculations from minimum and maximum values and then displaying those values in the listbox. I would like to send those values to the printer but for some reason can only get the first value printed and the remainder of the results remain inside the box. Any assistance would be greatly appreciated. I have been working with the statement printer.print and then the item or whatever I want printed. A screen shot such as form1.printform does not work as it only grabs that which is visible on the screen and does not get all of the results from the list box. Only that which is visible. [sig]<p> <br><a href=mailto:accrec@intergrafix.net>accrec@intergrafix.net</a><br><a href= > </a><br> [/sig]
 
beck,

Have you tried setting the listbox.listindex to get the various values?

A common VB approach for retrieving the items in the listbox list is (approximatly)

Code:
Private Sub cmdLstDpts_Click()

    Dim Idx As Integer

    For Idx = 0 To List1.ListCount - 1
        List1.ListIndex = Idx
        Printer.Print Space(5) & List1.Text
    Next Idx
    Printer.EndDoc

End Sub
Next Idx

[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top