Hi all,

I'm trying to build a sales program in which by adding multiple items in a RichTextBox, with the click of a button, the program can sum the price of these items and put it in a TextBox as the total sum of these values​​.

I've been going nuts about on how to write the code for this..It's the last part of the program that i need to conclude ir.

Thanks!

You could use the "Lines" property to access each line individually, then check if the line can be converted to a number as in

For Each line As String in RichTextBox1.Lines()
    If IsNumeric(line) Then
        sum += Convert.ToSingle(line)
    End If
Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.