Hello, I am new to this forum and to VB as well. I have this project for school that I need to code. I have had some help from another forum but there is one last thing that I can't get to work. According to VB and the other forum, I have everything correct in the code so far but I can't get an output. I need to get either of the shipping charges to display on "Shipinglabel"
Here is the code so far:
Your help is appreciated!Code:' Project name: Shipping Project ' Project purpose: Displays a shipping charge ' Created/revised by: <your name> on <current date> Option Explicit On Option Strict On Option Infer Off Public Class MainForm Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click Me.Close() End Sub Private Sub displayButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles displayButton.Click ' Determines the shipping charge for zip entered 'Declare Constants and Variables Const Shipcharge1 As Decimal = 32D Const Shipcharge2 As Decimal = 37.75D Dim Zip1 As Integer = 60618 Dim Zip2 As Integer = 60620 Dim zip3 As Integer = 60632 Dim Ziptextbox As Integer Dim Shippinglabel As Integer 'Assign user input to variables Integer.TryParse(CStr(Ziptextbox), Ziptextbox) Integer.TryParse(CStr(Shippinglabel), CInt(Shippinglabel)) If Ziptextbox = Zip1 Then Shippinglabel = CInt(Shipcharge1) Else Shippinglabel = CInt(Shipcharge2) End If If Ziptextbox = Zip2 Then Shippinglabel = CInt(Shipcharge1) Else Shippinglabel = CInt(Shipcharge2) End If If Ziptextbox = zip3 Then Shippinglabel = CInt(Shipcharge1) Else Shippinglabel = CInt(Shipcharge2) End If 'Display shipping charge End Sub Private Function TextBoxInteger() As String Throw New NotImplementedException End Function End Class




Reply With Quote