Results 1 to 4 of 4

Thread: Need help with VB.

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    1

    Need help with VB.

    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:

    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
    Your help is appreciated!
    Last edited by gep13; Oct 6th, 2011 at 01:40 AM. Reason: Added Code Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width