Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim itemName As String = txtItem.Text
- Dim qty As Double = CDbl(txtQTY.Text)
- Dim price As Double = CDbl(txtPrice.Text)
- Dim Total As Double = price * qty
- txtTotal.Text = Convert.ToString(Total)
- Dim row As Integer = grdNewInvoice.Rows.Count
- Dim data As TextBox() = New TextBox() {txtItem, txtQTY, txtPrice, txtTotal}
- grdNewInvoice.Rows.Add()
- For i As Integer = 0 To data.Length - 1
- grdNewInvoice(i, row).Value = data(0)
- Next
- End Sub
- 'grdNewInvoice.Rows(0).Cells(0).Value = itemName
- 'grdNewInvoice.Rows(0).Cells(1).Value = qty
- 'grdNewInvoice.Rows(0).Cells(2).Value = price
- 'grdNewInvoice.Rows(0).Cells(3).Value = Total
- Dim row As Integer = grdNewInvoice.Rows.Count
- Dim data As New List(Of String())
- data.Add({txtItem.Text, txtQTY.Text, txtPrice.Text, txtTotal.Text})
- data.Add({"Item2", "qtr2", "price2", "total2"})
- data.Add({"Item3", "qty3", "price3", "total3"})
- For i As Integer = 0 To data.Count - 1
- grdNewInvoice.Rows.Add(data(i))
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement