Public Class frmSources

  'frmSources's code

  Public sum As Double    'Holds the sum of the text boxes' values

  Private Sub frmSources_Load(ByVal sender As System.Object,
                              ByVal e As System.EventArgs) Handles MyBase.Load
    txtWages.Clear()
    txtIntIncome.Clear()
    txtDivIncome.Clear()
  End Sub

  Private Sub btnCompute_Click(ByVal sender As System.Object,
                               ByVal e As System.EventArgs) Handles btnCompute.Click
    'Store the total into the namespace-level variable sum
    sum = CDbl(txtWages.Text) + CDbl(txtIntIncome.Text) +
          CDbl(txtDivIncome.Text)
    Me.Close()   'Close the form as it is not needed any more
  End Sub

End Class