Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Public dblID() As Double
- Public dblQt() As Double
- Public dblPq() As Double
- Public dblDc() As Double
- Public dblTT() As Double
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- ListBox1.Items.Clear()
- ListBox1.Items.Add("ID" & vbTab & "Quantity" & vbTab & "Price/Q" & vbTab & "Discount" & vbTab & "Total")
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Dialog.ShowDialog()
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- Dim sum As Double = 0.0
- For i As Integer = dblTT(0) To dblTT.Count - 1
- sum = sum + dblTT(i)
- Next
- Label1.Text = sum
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- Dim txtfile As System.IO.StreamWriter
- txtfile = New IO.StreamWriter("C:\test\test.txt", False)
- For i = 0 To ListBox1.Items.Count - 1
- txtfile.WriteLine(ListBox1.Items.Item(i))
- Next
- txtfile.WriteLine("____________________________")
- txtfile.WriteLine("Total: " & "RM" & Label1.Text)
- txtfile.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement