I am very new to vb.net. I just starting taking it at school and I am having a hard time with it. Here is an order project we need to do for class. I can't get rid of the comma between the names in the list box and my decimals don't seem to line up either. I am very frustrated with this any help would be appreciated. Thanks.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Customer, Last, First, Address, City, Chairs, Sofas, Invoicenumber As String
Dim CommaName As Integer
Dim Datum As IO.StreamReader = IO.File.OpenText("C:\Temp\assign2.txt")
Dim Chair, Sofa, Tax, Cost, SalesTax, Total As Double
Chair = CDbl(Datum.ReadLine) * txtchairs.Text
Sofa = CDbl(Datum.ReadLine) * txtsofas.Text
Tax = CDbl(Datum.ReadLine)
Cost = Chair + Sofa
SalesTax = (Chair + Sofa) * Tax
Total = Chair + Sofa + SalesTax
Customer = txtcustomer.Text
CommaName = Customer.IndexOf(",")
Last = Customer.Substring(0, CommaName)
First = Customer.Substring(Customer.Length - CommaName + 1)
Address = txtaddress.Text
City = txtcity.Text
Chairs = txtchairs.Text
Sofas = txtsofas.Text
Invoicenumber = (Customer.Substring(0, 2).ToUpper & City.Substring(City.Length - 4).ToUpper)
With ListBox.Items
.Clear()
.Add("Invoice Number: " & vbTab & Invoicenumber)
.Add("")
.Add("Name: " & vbTab & First & " " & Last)
.Add("Address: " & vbTab & txtaddress.Text)
.Add("City: " & vbTab & txtcity.Text)
.Add("")
.Add("Number of Chairs: " & vbTab & txtchairs.Text)
.Add("Number of Sofas: " & vbTab & txtsofas.Text)
.Add("")
.Add(" Cost: " & FormatCurrency(Cost))
.Add(" Sales Tax: " & FormatCurrency(SalesTax))
.Add("" & vbTab & "" & "----------------")
.Add("Total Cost: " & FormatCurrency(Total))
End With
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' Clear all display in text list box
txtcustomer.Text = ""
txtaddress.Text = ""
txtcity.Text = ""
txtchairs.Text = ""
txtsofas.Text = ""
ListBox.Items.Clear()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub ListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox.SelectedIndexChanged
End Sub
End Class