Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How to add an accumulate button

$
0
0
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button2.Enabled = True
        Button1.Enabled = False

        Dim num As Double
        


        If Not Double.TryParse(TextBox3.Text, num) Then
            MessageBox.Show("Error in Retail Price, Wholesale Cost or Quantity", "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)

        ElseIf Not Double.TryParse(TextBox4.Text, num) Then
            MessageBox.Show("Error in Retail Price, Wholesale Cost or Quantity", "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)

        ElseIf Not Double.TryParse(TextBox5.Text, num) Then
            MessageBox.Show("Error in Retail Price, Wholesale Cost or Quantity", "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
        End If

        TextBox6.Text = (Val(TextBox3.Text) - Val(TextBox4.Text)) * Val(TextBox5.Text)
        TextBox7.Text = Val(TextBox6.Text) * 5 / 100
        TextBox8.Text = Val(TextBox6.Text) - Val(TextBox7.Text)



    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""

        TextBox1.Focus()

        Button1.Enabled = True
        Button2.Enabled = False

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.Close()

    End Sub

End Class 



This is an assignment which I found on the internet. I have done all the instruction except the last instruction on compute button. Though I'm a self learner I can't figure it out myself. The link of the assignment have bottom of the page. Can somebody explain it to me how to do it? Thank you.....
http://www.wpcadets.org/hsdept/business/vb/gradedlabs/lab3/lab3.htm

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>