No Modify? This thing took off and posted on its own.
Anyway, to continue.
Public sub MainRout()
dim I as integer
dim S(10) as string
S(0)="Red"
S(1)="Green"
S(2)="Blue"
I=int(rnd*3)
PrintToPrinter(S(I)) 'HOW DO I DO THIS??????????????
End sub
'Note, the below routine was stolen from previous
<i>Help</i>, but cannot be called from inside code.
Public Sub pd_PrintPage(ByVal sender As Object, ByVal ev
As PrintPageEventArgs)
Dim LnPPg As Single = 0
Dim pfnt As Font
Dim MrgnL As Single = ev.MarginBounds.Left
Dim MrgnT As Single = ev.MarginBounds.Top
Dim SL As String = Nothing
' Calculate the number of lines per page.
PFnt = New Font(FtNm, FtSz)
LnPPg = ev.MarginBounds.Height / PFnt.GetHeight
(ev.Graphics)
' Iterate over the file, printing each line.
ev.Graphics.DrawString(SP, PFnt, Brushes.Black,
MrgnL, PY, New StringFormat())
' If more lines exist, print another page.
If Not (SL Is Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
End Sub