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(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnNext.Click
mintTotal += 1
msdtone(mintTot al).int1 = CInt(txt1.Text)
msdtone(mintTot al).dec1 = CInt(txt2.Text)
msdtone(mintTot al).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.PrintP ageEventArgs) 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(mintTot al).int1
Strdec1 = msdtone(mintTot al).dec1
Strint2 = msdtone(mintTot al).int2
strPrintLine = String.Format(" {0, -15}", "{1, -20}", "{2, -20}", Strint1, Strdec1, strint2)
e.Graphics.Draw String(strPrint Line, fntPrintFont, Brushes.Black, 100, 200)
End Sub
Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MenuItem2.Click
PrintDocument1. Print()
End Sub
End Class
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(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnNext.Click
mintTotal += 1
msdtone(mintTot al).int1 = CInt(txt1.Text)
msdtone(mintTot al).dec1 = CInt(txt2.Text)
msdtone(mintTot al).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.PrintP ageEventArgs) 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(mintTot al).int1
Strdec1 = msdtone(mintTot al).dec1
Strint2 = msdtone(mintTot al).int2
strPrintLine = String.Format(" {0, -15}", "{1, -20}", "{2, -20}", Strint1, Strdec1, strint2)
e.Graphics.Draw String(strPrint Line, fntPrintFont, Brushes.Black, 100, 200)
End Sub
Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MenuItem2.Click
PrintDocument1. Print()
End Sub
End Class