Boolean variable Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nilou
    New Member
    • Oct 2011
    • 9

    Boolean variable Help

    Hi,

    I'm writing a form to get numbers in order to calculate the price. if numbers and the code of business is wrong it will give me message box error.
    The result will appear on a rich text box.
    My professor wants me to set declare separate string variables to displaying text in the richtextbox.
    MY QUESTION :For Boolean variable, assign false to Boolean variable, when user input is invalid. Display results in the richtextbox, when Boolean is true, BUT IF IT IS FALSE : don't display the result.
    My out put doesn't calculate the function and don't know how to set the Boolean to not display the output!!

    Please help!

    Here is my Code:
    Code:
    'Declare variables to store the output
            Dim strOutOffice As String = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c")
            Dim strOutVisual As String = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c")
            Dim strOutQuick As String = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c")
            Dim strOutMaker As String = "File Maker Pro 2011:" & decTotalMaker.ToString("c")
            Dim strGrandTotal As String = "Grand Total:" & decGrandTotal.ToString("c")
    
    Dim blnAnswer As Boolean = True      'Declare a boolean as true
    
    
    Process------
    .
    .
    .
    
    'Output ---------------------------------------
            rtbSalesOrder.Clear()
            rtbSalesOrder.AppendText(strOutOffice & vbNewLine)
            rtbSalesOrder.AppendText(strOutVisual & vbNewLine)
            rtbSalesOrder.AppendText(strOutQuick & vbNewLine)
            rtbSalesOrder.AppendText(strOutMaker & vbNewLine)
            rtbSalesOrder.AppendText(strGrandTotal & vbNewLine)
    Last edited by Frinavale; Oct 7 '11, 07:41 PM. Reason: Added code tags and fixed the spelling of the word please...Please refrain from using leet-speak on this forum.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    So, where is your if statement checking to see if the boolean is true.
    It's pretty simple to say:
    Code:
    Dim myBoolean As Boolean
    '.......
    If myBoolean = True Then
      'do something
    Else
      'do something else...
    End If
    -Frinny

    Comment

    • Nilou
      New Member
      • Oct 2011
      • 9

      #3
      Thank you Frinavale,

      what would be my Boolean not display the answer in the text box? Do i have to use rtbSalesOrder.C lear()
      or there is something else to not to display the output in richTextbox?

      is this correct:
      Code:
      strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
      
      
              If blnAnswer = True Then
      
                  rtbSalesOrder.AppendText(strOutOffice)
              Else
                  rtbSalesOrder.Clear()
              End If
      Last edited by Frinavale; Oct 7 '11, 08:32 PM. Reason: Please post code in code tags.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        It's not my project so I'm not sure what you're supposed to display in the TextBox.

        According to what you previously posted, I would say that if false then you need to clear the TextBox because you don't want to show anything....

        -Frinny

        Comment

        • Nilou
          New Member
          • Oct 2011
          • 9

          #5
          Here is my Code:
          Code:
          strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
          
          
          If blnAnswer = True Then
            rtbSalesOrder.AppendText(strOutOffice)
          Else
            rtbSalesOrder.Clear()
          End If
          ( if it is right, i's not working :(
          Last edited by Frinavale; Oct 7 '11, 08:32 PM.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            What about it is not working ?

            Comment

            • Nilou
              New Member
              • Oct 2011
              • 9

              #7
              no it is not :(((
              here is he whole code:
              Code:
              Public Class SoftwareSales
                  
              
                  Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
                      'Declaration --------------------------
              
                      'Declare constants for retail Price
                      Const decOffice As Decimal = 500
                      Const decVisual As Decimal = 800
                      Const decQuick As Decimal = 230
                      Const decMaker As Decimal = 300
              
                      'Declare variables to store the quantities sold
                      Dim shoMsOffice As Short
                      Dim shoMsVs As Short
                      Dim shoMsQuick As Short
                      Dim shoMsMaker As Short
              
                      'Declare variables to store the total cost 
                      Dim decTotalOffice As Decimal
                      Dim decTotalVS As Decimal
                      Dim decTotalQuick As Decimal
                      Dim decTotalMaker As Decimal
                      Dim decGrandTotal As Decimal
              
                      Dim strMsBizType As String  'Declare a variable to store business type
              
                      'Declare variables to store the applied discount 
                      Dim intDisMsOffice As Integer = 1
                      Dim intDisMsVs As Integer = 1
                      Dim intDisMsQuick As Integer = 1
                      Dim intDisMaker As Integer = 1
              
                      Dim blnAnswer As Boolean = True      'Declare a boolean as true
              
                      'Declare variables to store the output
                      Dim strOutOffice As String
                      Dim strOutVisual As String
                      Dim strOutQuick As String
                      Dim strOutMaker As String
                      Dim strGrandTotal As String
              
              
              
              
                      'Input ----------------------------
              
                      strMsBizType = txtBizType.Text
                      strMsBizType = strMsBizType.ToUpper
              
                      If strMsBizType = "B" Or strMsBizType = "b" Or strMsBizType = "A" Or strMsBizType = "a" Or strMsBizType = "N" Or strMsBizType = "n" Then
                          blnAnswer = True
                      Else
                          MsgBox("Please enter B,A, or N for business type.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                          
                      End If
              
              
              
                      'strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
                      'rtbSalesOrder.AppendText(strOutOffice)
              
              
              
              
                      If IsNumeric(txtMsOffice.Text) And txtMsOffice.Text > 0 Then
                          shoMsOffice = txtMsOffice.Text
                      Else
                          MsgBox("Please enter number of quantities sold for Microsoft Office Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                      End If
              
              
                      If IsNumeric(txtMsVs.Text) And txtMsVs.Text > 0 Then
                          shoMsVs = txtMsVs.Text
                      Else
                          MsgBox("Please enter number of quantities sold for Microsoft Visual Studio Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                      End If
              
                      If IsNumeric(txtMsQuick.Text) And txtMsQuick.Text > 0 Then
                          shoMsQuick = txtMsQuick.Text
                      Else
                          MsgBox("Please enter number of quantities sold for Intuit Quick Books 2012.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                      End If
              
                      If IsNumeric(txtMsMaker.Text) And txtMsMaker.Text > 0 Then
                          shoMsMaker = txtMsMaker.Text
                      Else
                          MsgBox("Please enter number of quantities sold for File Maker Pro 2011.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                      End If
              
              
                      'Process -------------------------------------
              
              
              .
              .
              .
              
                      'Output ---------------------------------------
              
                      rtbSalesOrder.Clear()
              
                      strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
                      If blnAnswer = True Then
                          rtbSalesOrder.AppendText(strOutOffice)
                      Else
                          rtbSalesOrder.Clear(strOutOffice)
                      End If
              
                      strOutVisual = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c") & vbNewLine
                      If blnAnswer = True Then
                          rtbSalesOrder.AppendText(strOutVisual)
                      Else
                          rtbSalesOrder.Clear(strOutVisual)
                      End If
              
              
                      strOutQuick = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c") & vbNewLine
                      If blnAnswer = True Then
                          rtbSalesOrder.AppendText(strOutQuick)
                      Else
                          rtbSalesOrder.Clear(strOutQuick)
                      End If
              
                      strOutMaker = "File Maker Pro 2011:" & decTotalMaker.ToString("c") & vbNewLine
                      If blnAnswer = True Then
                          rtbSalesOrder.AppendText(strOutMaker)
                      Else
                          rtbSalesOrder.Clear(strOutMaker)
                      End If
              
              
                      strGrandTotal = "Grand Total:" & decGrandTotal.ToString("c") & vbNewLine
                      If blnAnswer = True Then
                          rtbSalesOrder.AppendText(strGrandTotal)
                      Else
                          rtbSalesOrder.Clear(strGrandTotal)
                      End If
                      
                      'rtbSalesOrder.Clear()
                      'rtbSalesOrder.AppendText("Microsoft Office Pro 2010:" & strOutOffice & vbNewLine)
                      'rtbSalesOrder.AppendText("Microsoft Visual Sudio Pro 2010:" & strOutVisual & vbNewLine)
                      'rtbSalesOrder.AppendText("Intuit Quick Books 2012:" & strOutQuick & vbNewLine)
                      'rtbSalesOrder.AppendText("File Maker Pro 2011:" & strOutMaker & vbNewLine)
                      'rtbSalesOrder.AppendText("Grand Total:" & strGrandTotal & vbNewLine)
              
                  End Sub
              
                  Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
                      'Clear UserInput & and assign default values
                      txtMsOffice.Text = 0
                      txtMsVs.Text = 0
                      txtMsQuick.Text = 0
                      txtMsMaker.Text = 0
                      txtBizType.Text = "B"
                      rtbSalesOrder.Clear()
              
                      txtMsOffice.Focus()      ' Reset the focus.
                  End Sub
              
                  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
                      End
                  End Sub
              End Class
              Last edited by Frinavale; Oct 7 '11, 09:09 PM. Reason: Added code tags. PLEASE post code in code tags.

              Comment

              • Nilou
                New Member
                • Oct 2011
                • 9

                #8
                This one has the process too:

                Code:
                Public Class SoftwareSales
                    
                
                    Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
                        'Declaration --------------------------
                
                        'Declare constants for retail Price
                        Const decOffice As Decimal = 500
                        Const decVisual As Decimal = 800
                        Const decQuick As Decimal = 230
                        Const decMaker As Decimal = 300
                
                        'Declare variables to store the quantities sold
                        Dim shoMsOffice As Short
                        Dim shoMsVs As Short
                        Dim shoMsQuick As Short
                        Dim shoMsMaker As Short
                
                        'Declare variables to store the total cost 
                        Dim decTotalOffice As Decimal
                        Dim decTotalVS As Decimal
                        Dim decTotalQuick As Decimal
                        Dim decTotalMaker As Decimal
                        Dim decGrandTotal As Decimal
                
                        Dim strMsBizType As String  'Declare a variable to store business type
                
                        'Declare variables to store the applied discount 
                        Dim intDisMsOffice As Integer = 1
                        Dim intDisMsVs As Integer = 1
                        Dim intDisMsQuick As Integer = 1
                        Dim intDisMaker As Integer = 1
                
                        Dim blnAnswer As Boolean = True      'Declare a boolean as true
                
                        'Declare variables to store the output
                        Dim strOutOffice As String
                        Dim strOutVisual As String
                        Dim strOutQuick As String
                        Dim strOutMaker As String
                        Dim strGrandTotal As String
                
                
                
                
                        'Input ----------------------------
                
                        strMsBizType = txtBizType.Text
                        strMsBizType = strMsBizType.ToUpper
                
                        If strMsBizType = "B" Or strMsBizType = "b" Or strMsBizType = "A" Or strMsBizType = "a" Or strMsBizType = "N" Or strMsBizType = "n" Then
                            blnAnswer = True
                        Else
                            MsgBox("Please enter B,A, or N for business type.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                            
                        End If
                
                
                
                        'strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
                        'rtbSalesOrder.AppendText(strOutOffice)
                
                
                
                
                        If IsNumeric(txtMsOffice.Text) And txtMsOffice.Text > 0 Then
                            shoMsOffice = txtMsOffice.Text
                        Else
                            MsgBox("Please enter number of quantities sold for Microsoft Office Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                        End If
                
                
                        If IsNumeric(txtMsVs.Text) And txtMsVs.Text > 0 Then
                            shoMsVs = txtMsVs.Text
                        Else
                            MsgBox("Please enter number of quantities sold for Microsoft Visual Studio Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                        End If
                
                        If IsNumeric(txtMsQuick.Text) And txtMsQuick.Text > 0 Then
                            shoMsQuick = txtMsQuick.Text
                        Else
                            MsgBox("Please enter number of quantities sold for Intuit Quick Books 2012.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                        End If
                
                        If IsNumeric(txtMsMaker.Text) And txtMsMaker.Text > 0 Then
                            shoMsMaker = txtMsMaker.Text
                        Else
                            MsgBox("Please enter number of quantities sold for File Maker Pro 2011.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
                        End If
                
                
                        'Process -------------------------------------
                
                        'Discount table for Regular Business 
                        If strMsBizType = "B" Or strMsBizType = "b" Then
                            decTotalOffice = decOffice * shoMsOffice
                            decTotalVS = decVisual * shoMsVs
                            decTotalQuick = decQuick * shoMsQuick
                            decTotalMaker = decMaker * shoMsMaker
                        End If
                
                        'Discount table for Academic
                        If strMsBizType = "A" Or strMsBizType = "a" Then
                
                            If (shoMsOffice = shoMsVs = shoMsQuick = shoMsMaker) <= 10 Then
                                decTotalOffice = shoMsOffice * decOffice
                                decTotalVS = decVisual * shoMsVs
                                decTotalQuick = decQuick * shoMsQuick
                                decTotalMaker = decMaker * shoMsMaker
                
                                Select Case shoMsOffice
                                    Case 10 To 19
                                        intDisMsOffice = (shoMsOffice * decOffice) * 0.25
                                        decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                        Select Case shoMsVs
                                            Case 10 To 19
                
                                                intDisMsVs = (shoMsVs * decVisual) * 0.25
                                                decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                                Select Case shoMsQuick
                                                    Case 10 To 19
                                                        intDisMsQuick = (shoMsQuick * decQuick) * 0.05
                                                        decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                        Select Case shoMsMaker
                                                            Case 10 To 19
                                                                intDisMaker = (shoMsMaker * decMaker) * 0.05
                                                                decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                        End Select
                                                End Select
                                        End Select
                                End Select
                
                                Select Case shoMsOffice
                                    Case 20 To 49
                                        intDisMsOffice = (shoMsOffice * decOffice) * 0.35
                                        decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                                        Select Case shoMsVs
                
                                        End Select
                                    Case 20 To 49
                                        intDisMsVs = (shoMsVs * decVisual) * 0.35
                                        decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                        Select Case shoMsQuick
                                            Case 20 To 49
                                                intDisMsQuick = (shoMsQuick * decQuick) * 0.1
                                                decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                Select Case shoMsMaker
                                                    Case 20 To 49
                                                        intDisMaker = (shoMsMaker * decMaker) * 0.15
                                                        decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                End Select
                                        End Select
                                End Select
                
                                Select Case shoMsOffice
                                    Case 50 To 99
                                        intDisMsOffice = (shoMsOffice * decOffice) * 0.5
                                        decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                        Select Case shoMsVs
                                            Case 50 To 99
                                                intDisMsVs = (shoMsVs * decVisual) * 0.5
                                                decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                                Select Case shoMsQuick
                                                    Case 50 To 99
                                                        intDisMsQuick = (shoMsQuick * decQuick) * 0.15
                                                        decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                        Select Case shoMsMaker
                                                            Case 50 To 99
                                                                intDisMaker = (shoMsMaker * decMaker) * 0.25
                                                                decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                        End Select
                                                End Select
                                        End Select
                                End Select
                
                                Select Case shoMsOffice
                                    Case Is >= 100
                                        intDisMsOffice = (shoMsOffice * decOffice) * 0.75
                                        decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                        Select Case shoMsVs
                                            Case Is >= 100
                                                intDisMsVs = (shoMsVs * decVisual) * 0.75
                                                decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                                Select Case shoMsQuick
                                                    Case Is >= 100
                                                        intDisMsQuick = (shoMsQuick * decQuick) * 0.25
                                                        decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                        Select Case shoMsMaker
                                                            Case Is >= 100
                                                                intDisMaker = (shoMsMaker * decMaker) * 0.4
                                                                decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                        End Select
                                                End Select
                                        End Select
                                End Select
                            End If
                        End If
                
                
                        'Discount table for NonProfit Organizations
                        If strMsBizType = "N" Or strMsBizType = "n" Then
                
                            If (shoMsOffice = shoMsVs = shoMsQuick = shoMsMaker) <= 10 Then
                                decTotalOffice = shoMsOffice * decOffice
                                decTotalVS = decVisual * shoMsVs
                                decTotalQuick = decQuick * shoMsQuick
                                decTotalMaker = decMaker * shoMsMaker
                            End If
                
                            Select Case shoMsOffice
                                Case 10 To 19
                                    intDisMsOffice = (shoMsOffice * decOffice) * 0.25
                                    decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                    Select Case shoMsVs
                                        Case 10 To 19
                
                                            intDisMsVs = (shoMsVs * decVisual) * 0.25
                                            decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                            Select Case shoMsQuick
                                                Case 10 To 19
                                                    intDisMsQuick = (shoMsQuick * decQuick) * 0.1
                                                    decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                    Select Case shoMsMaker
                                                        Case 10 To 19
                                                            intDisMaker = (shoMsMaker * decMaker) * 10
                                                            decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                    End Select
                                            End Select
                                    End Select
                            End Select
                
                            Select Case shoMsOffice
                                Case 20 To 49
                                    intDisMsOffice = (shoMsOffice * decOffice) * 0.35
                                    decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                                    Select Case shoMsVs
                
                                    End Select
                                Case 20 To 49
                                    intDisMsVs = (shoMsVs * decVisual) * 0.35
                                    decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                    Select Case shoMsQuick
                                        Case 20 To 49
                                            intDisMsQuick = (shoMsQuick * decQuick) * 0.25
                                            decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                            Select Case shoMsMaker
                                                Case 20 To 49
                                                    intDisMaker = (shoMsMaker * decMaker) * 0.15
                                                    decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                            End Select
                                    End Select
                            End Select
                
                            Select Case shoMsOffice
                                Case 50 To 99
                                    intDisMsOffice = (shoMsOffice * decOffice) * 0.45
                                    decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                    Select Case shoMsVs
                                        Case 50 To 99
                                            intDisMsVs = (shoMsVs * decVisual) * 0.45
                                            decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                            Select Case shoMsQuick
                                                Case 50 To 99
                                                    intDisMsQuick = (shoMsQuick * decQuick) * 0.4
                                                    decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                    Select Case shoMsMaker
                                                        Case 50 To 99
                                                            intDisMaker = (shoMsMaker * decMaker) * 0.2
                                                            decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                    End Select
                                            End Select
                                    End Select
                            End Select
                
                            Select Case shoMsOffice
                                Case Is >= 100
                                    intDisMsOffice = (shoMsOffice * decOffice) * 0.6
                                    decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
                
                                    Select Case shoMsVs
                                        Case Is >= 100
                                            intDisMsVs = (shoMsVs * decVisual) * 0.6
                                            decTotalVS = (shoMsVs * decVisual) - intDisMsVs
                
                                            Select Case shoMsQuick
                                                Case Is >= 100
                                                    intDisMsQuick = (shoMsQuick * decQuick) * 0.5
                                                    decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
                
                                                    Select Case shoMsMaker
                                                        Case Is >= 100
                                                            intDisMaker = (shoMsMaker * decMaker) * 0.25
                                                            decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
                                                    End Select
                                            End Select
                                    End Select
                            End Select
                        End If
                
                
                
                        decGrandTotal = decTotalOffice + decTotalVS + decTotalQuick + decTotalMaker
                
                        'Output ---------------------------------------
                
                        rtbSalesOrder.Clear()
                
                        strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
                        If blnAnswer = True Then
                            rtbSalesOrder.AppendText(strOutOffice)
                        Else
                            rtbSalesOrder.Clear(strOutOffice)
                        End If
                
                        strOutVisual = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c") & vbNewLine
                        If blnAnswer = True Then
                            rtbSalesOrder.AppendText(strOutVisual)
                        Else
                            rtbSalesOrder.Clear(strOutVisual)
                        End If
                
                
                        strOutQuick = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c") & vbNewLine
                        If blnAnswer = True Then
                            rtbSalesOrder.AppendText(strOutQuick)
                        Else
                            rtbSalesOrder.Clear(strOutQuick)
                        End If
                
                        strOutMaker = "File Maker Pro 2011:" & decTotalMaker.ToString("c") & vbNewLine
                        If blnAnswer = True Then
                            rtbSalesOrder.AppendText(strOutMaker)
                        Else
                            rtbSalesOrder.Clear(strOutMaker)
                        End If
                
                
                        strGrandTotal = "Grand Total:" & decGrandTotal.ToString("c") & vbNewLine
                        If blnAnswer = True Then
                            rtbSalesOrder.AppendText(strGrandTotal)
                        Else
                            rtbSalesOrder.Clear(strGrandTotal)
                        End If
                        
                        'rtbSalesOrder.Clear()
                        'rtbSalesOrder.AppendText("Microsoft Office Pro 2010:" & strOutOffice & vbNewLine)
                        'rtbSalesOrder.AppendText("Microsoft Visual Sudio Pro 2010:" & strOutVisual & vbNewLine)
                        'rtbSalesOrder.AppendText("Intuit Quick Books 2012:" & strOutQuick & vbNewLine)
                        'rtbSalesOrder.AppendText("File Maker Pro 2011:" & strOutMaker & vbNewLine)
                        'rtbSalesOrder.AppendText("Grand Total:" & strGrandTotal & vbNewLine)
                
                    End Sub
                
                    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
                        'Clear UserInput & and assign default values
                        txtMsOffice.Text = 0
                        txtMsVs.Text = 0
                        txtMsQuick.Text = 0
                        txtMsMaker.Text = 0
                        txtBizType.Text = "B"
                        rtbSalesOrder.Clear()
                
                        txtMsOffice.Focus()      ' Reset the focus.
                    End Sub
                
                    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
                        End
                    End Sub
                End Class
                Last edited by Frinavale; Oct 7 '11, 09:09 PM. Reason: Added code tags...again please post code in code tags.

                Comment

                Working...