I'm not very familiar with RichTextBox so I don't know if it can do what I'm thinking.

I have 2 textbox, Quantity and Type. What I want is, when type in both, and click Save, it will save in the RichTextBox. Then click Clear, the text in both textbox will clear but no in the RichTextBox. What I want to know is, can it has column, Quantity is 1st, Type is 2nd? How do I make it to save in new line?

I've tried and got it to save in RichTextBox when the textbox is cleared but not the new line and column.

Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
        For Each IndividualCoffeeSale As CoffeeSale In TransactionCoffeeSale
            If IndividualCoffeeSale.QuantityString <> "" Then
                RichTextBox1.Text = IndividualCoffeeSale.QuantityString
            End If
    End Sub

Need your expertise. Thank you. :)

7 Years
Discussion Span
Last Post by lielee

See if this helps.

If Not RichTextBox1.Text = "" Then '// if Not empty, add a New line and content.
            RichTextBox1.Text &= vbNewLine & TextBox1.Text & " - " & TextBox2.Text
        Else '// if empty, just add content.
            RichTextBox1.Text = TextBox1.Text & " - " & TextBox2.Text
        End If
        '// Clear TextBoxes.
        TextBox1.Clear() : TextBox2.Clear()
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.