When I try to print with the following code, I only get {1,-29}. I am trying to print the data entered into three text boxes with this structure. Any help would be highly apprieciated. Thank you in advance.
Public Class frmStructure Inherits System.Windows.Forms.Form
Structure one
Dim int1 As Integer
Dim dec1 As Decimal
Dim int2 As Integer
End Structure
Dim msdtone(9) As one
Dim mintTotal As Integer
End Sub
'
''Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
mintTotal += 1
msdtone(mintTotal).int1 = CInt(txt1.Text)
msdtone(mintTotal).dec1 = CInt(txt2.Text)
msdtone(mintTotal).int2 = CInt(txt3.Text)
txt1.Clear()
txt2.Clear()
txt3.Clear()
txt1.Focus()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim intListIndex As Integer
Dim fntPrintFont As New Font("Couier new", 12)
Dim sngPrintX As Single
Dim sngPrintY As Single
Dim intLineHeight As Integer
Dim strPrintLine As String
Dim Strint1 As Integer
Dim Strdec1 As Decimal
Dim strint2 As Integer
Strint1 = msdtone(mintTotal).int1
Strdec1 = msdtone(mintTotal).dec1
Strint2 = msdtone(mintTotal).int2
strPrintLine = String.Format("{0, -15}", "{1, -20}", "{2, -20}", Strint1, Strdec1, strint2)
e.Graphics.DrawString(strPrintLine, fntPrintFont, Brushes.Black, 100, 200)
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
PrintDocument1.Print()
End Sub
End Class