I am needing help in understanding how to declare variables properly. I am needing to write as program that calculates the commission for a sales person. I keep getting a error listed below. I thought I declared the salestextbox, costtextbox as integers correctly to use them in the calculation. I Copied my code below also. I have reread the chapter again and I am still lose. What am I doing wrong?
Error 1 Value of type 'Double' cannot be converted to 'System.Windows.Forms.TextBox'. C:\Users\Purrenhage\AppData\Local\Temporary Projects\WindowsApplication1\Autocenter3.vb 36 29 WindowsApplication1
' Scott Purrenhage
' 7-18-11
' Program is going to take a persons name, selling price, cost value and calculate the commission in a text box.
' The commission rate is set at 20%.
' Needs to have a print, clear input, and exit buttons.
' needing to be able to give a error message to the user to correct input values.
Public Class AutoCenter3Form
'Declaring variables
Const COMMISSION_RATE As Decimal = 0.2D
Private Sub PrintButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintButton.Click
'print to a preview
PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
PrintForm1.Print()
End Sub
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
'Exit the program
Me.Close()
End Sub
Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
' Clear all the input values
NameBox.Text = String.Empty
SalestextBox.Text = String.Empty
Costtextbox.Text = String.Empty
End Sub
Private Sub CalcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcButton.Click
'Calculate the commission and display it in the commissiontextbox
Dim Salestextbox, Costtextbox As Integer
Salestextbox = Integer.Parse(Salestextbox.ToString)
Costtextbox = Integer.Parse(Costtextbox.ToString)
Commissiontextbox = COMMISSION_RATE * (Salestextbox - Costtextbox).ToString("C")
End Sub
End Class