0

我有以下代码,想做两件事。我想将两个 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
4

1 回答 1

0

WriteLine("")每次要打印空行时都可以调用。

于 2013-10-10T03:43:40.717 回答