Hi! Im new to these forums and am just beginning to learn VB. My main area of IT is web development and I have about 2 years of programming experience with XHTML, CSS, and JavaScript. My program is fairly simple, I need to create a Windows Form Application that calculates sales tax when the tax rate is 6.5%. When the Calculate button is clicked, the amount input is multiplied by the rate as a decimal, .065. The result is then displayed in a textbox in a currency format. This result is added to the orginal amount to display in the Total textbox. Im not exactly sure how to take the outputs and display them in the correct textboxes. Here is my code so far:
VB.NET:
Option Explicit On
Option Strict On
Public Class Form1
Private Sub btnExit_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reset.Click
txtInput.Text = ""
lblResult.Text = Nothing
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim decInput As Decimal
Dim decOutput As Decimal
decInput = Convert.ToDecimal(txtInput.Text)
decOutput = decInput * (0.065)
lblResult.Text = decOutput.ToString
decOutput = decInput + decOutput
lblResult.Text = decOutput.ToString
End Sub
End Class