لطفا يكي به من بگه چه جوري مي تونم اين دستورات رو به پرينتر بفرستم
Public Sub nemoodar()
clear()
Dim graph1 As Graphics
graph1 = Me.CreateGraphics()
Dim brush1 As Brush
brush1 = System.Drawing.Brushes.Black
Dim rec As New Rectangle
rec.X = 45
rec.Y = 250
rec.Width = 330
rec.Height = 130
Dim pen1 As Pen
pen1 = New Pen(Color.Black, 1)
graph1.DrawRectangle(pen1, rec)
For i As Integer = 75 To 360 Step 30
graph1.DrawLine(pen1, i, 250, i, 380)
Next
For i As Integer = 276 To 370 Step 26
pen1.DashStyle = Drawing2D.DashStyle.Dash
graph1.DrawLine(pen1, 45, i, 375, i)
Next
Dim f As Font
f = New System.Drawing.Font("arial", 10, FontStyle.Regular)
Dim b As Brush
b = System.Drawing.Brushes.Black
graph1.DrawString("81", f, b, 337, 389.5)
graph1.DrawString("82", f, b, 307, 389.5)
graph1.DrawString("83", f, b, 277, 389.5)
graph1.DrawString("84", f, b, 247, 389.5)
graph1.DrawString("85", f, b, 217, 389.5)
graph1.DrawString("86", f, b, 187, 389.5)
graph1.DrawString("87", f, b, 157, 389.5)
graph1.DrawString("88", f, b, 127, 389.5)
graph1.DrawString("89", f, b, 97, 389.5)
graph1.DrawString("90", f, b, 67, 389.5)
Dim max As Double = 0
Dim min As Double = 10000
For i As Integer = 2 To 11
If DataGridView1.Rows(2).Cells(i).Value > max Then
max = DataGridView1.Rows(2).Cells(i).Value
End If
If DataGridView1.Rows(2).Cells(i).Value < min Then
min = DataGridView1.Rows(2).Cells(i).Value
End If
Next
If min = max Then
Exit Sub
End If
Dim fasele As Double = max - min
Dim fnoghte As Integer = Math.Round(120 / fasele, 0)
Dim y81 As Integer = 375 - (DataGridView1.Rows(2).Cells(2).Value - min) * fnoghte
Dim y82 As Integer = 375 - (DataGridView1.Rows(2).Cells(3).Value - min) * fnoghte
Dim y83 As Integer = 375 - (DataGridView1.Rows(2).Cells(4).Value - min) * fnoghte
Dim y84 As Integer = 375 - (DataGridView1.Rows(2).Cells(5).Value - min) * fnoghte
Dim y85 As Integer = 375 - (DataGridView1.Rows(2).Cells(6).Value - min) * fnoghte
Dim y86 As Integer = 375 - (DataGridView1.Rows(2).Cells(7).Value - min) * fnoghte
Dim y87 As Integer = 375 - (DataGridView1.Rows(2).Cells(8).Value - min) * fnoghte
Dim y88 As Integer = 375 - (DataGridView1.Rows(2).Cells(9).Value - min) * fnoghte
Dim y89 As Integer = 375 - (DataGridView1.Rows(2).Cells(10).Value - min) * fnoghte
Dim y90 As Integer = 375 - (DataGridView1.Rows(2).Cells(11).Value - min) * fnoghte
Dim pen2 As Pen
pen2 = New Pen(Color.Black, 2)
If y81 <> 375 Then
graph1.FillEllipse(brush1, 343, y81 - 2, 5, 5)
End If
If y82 <> 375 Then
graph1.FillEllipse(brush1, 313, y82 - 2, 5, 5)
End If
If y83 <> 375 Then
graph1.FillEllipse(brush1, 283, y83 - 2, 5, 5)
End If
If y84 <> 375 Then
graph1.FillEllipse(brush1, 253, y84 - 2, 5, 5)
End If
If y85 <> 375 Then
graph1.FillEllipse(brush1, 223, y85 - 2, 5, 5)
End If
If y86 <> 375 Then
graph1.FillEllipse(brush1, 193, y86 - 2, 5, 5)
End If
If y87 <> 375 Then
graph1.FillEllipse(brush1, 163, y87 - 2, 5, 5)
End If
If y88 <> 375 Then
graph1.FillEllipse(brush1, 133, y87 - 2, 5, 5)
End If
If y89 <> 375 Then
graph1.FillEllipse(brush1, 103, y89 - 2, 5, 5)
End If
If y90 <> 375 Then
graph1.FillEllipse(brush1, 73, y90 - 2, 5, 5)
End If
If y81 <> 375 And y82 <> 375 Then
graph1.DrawLine(pen2, 345, y81, 315, y82)
End If
If y82 <> 375 And y83 <> 375 Then
graph1.DrawLine(pen2, 315, y82, 285, y83)
End If
If y83 <> 375 And y84 <> 375 Then
graph1.DrawLine(pen2, 285, y83, 255, y84)
End If
If y84 <> 375 And y85 <> 375 Then
graph1.DrawLine(pen2, 255, y84, 225, y85)
End If
If y85 <> 375 And y86 <> 375 Then
graph1.DrawLine(pen2, 225, y85, 195, y86)
End If
If y86 <> 375 And y87 <> 375 Then
graph1.DrawLine(pen2, 195, y86, 165, y87)
End If
If y87 <> 375 And y88 <> 375 Then
graph1.DrawLine(pen2, 165, y87, 135, y88)
End If
If y88 <> 375 And y89 <> 375 Then
graph1.DrawLine(pen2, 135, y88, 105, y89)
End If
If y89 <> 375 And y90 <> 375 Then
graph1.DrawLine(pen2, 105, y89, 75, y90)
End If
End Sub