我有以下代码,想做两件事。我想将两个 W.writeLine 代码分开一两行。VbCrlf 似乎不起作用我得到错误。我还想将 Total Due 和 TotalDueTextBox.Text 的颜色更改为红色。有什么建议么?
Private Sub SaveAsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SaveAsToolStripMenuItem.Click
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
Dim i As Integer
For i = 0 To PurchaseListBox.Items.Count - 1
W.WriteLine(PurchaseListBox.Items.Item(i))
Next
Dim TotalDue As String = TotalDueTextBox.Text
W.WriteLine(vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & "TotalDue" & TotalDueTextBox.Text.PadLeft(14, ""))
W.Close()
End Sub