"Total Due" & VBTAB & TotalDueTextBox.text
messageBox (最終行) の下部に表示しようとしている次のコードがあります。一番上にしか表示されません。助言がありますか?
Private Sub TotalSalesByProductToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TotalSalesByProductToolStripMenuItem.Click
'Display output to immediate window
Dim RowInteger As Integer
Dim SalesString As String = "ProductID" & vbTab & vbTab & "Amount" & vbCrLf & "Total Due" & vbTab & vbTab & TotalDueTextBox.Text & vbCrLf
For Each ProductItem As Product In InventoryProduct
'Build string to display
SalesString &= ProductItem.ProductIDString & vbTab & vbTab & ProductSalesTotalDecimal(RowInteger).ToString("C2") & vbCrLf
'Increment RowInteger
RowInteger += 1
Next
'Display string to a MessageBox
' Debug.WriteLine(TotalDueTextBox.Text)
Dim Answer As String
Dim MyNote As String
MyNote = MessageBox.Show(SalesString, "Sales Totals, Do you want to save this File", MessageBoxButtons.OK, MessageBoxIcon.Information)
MyNote = "Do you want to save the Sales Totals Summary to File?"
Answer = MsgBox(MyNote, vbYesNo, "Sales Totals to File")
If Answer = vbNo Then
'Code for No Responce
End If
If Answer = vbYes Then
'Code for Yes Responce
sFile.InitialDirectory = ("C:\")
sFile.FileName = ("Save As...")
sFile.Filter = ("Only Text Files (*.txt)|*.txt")
sFile.ShowDialog()
Dim W As New IO.StreamWriter(sFile.FileName, True) ' notes from class need messgbox
W.WriteLine(SalesString)
W.Close()
End If
End Sub