Link to home
Start Free TrialLog in
Avatar of HawaiiDragon
HawaiiDragon

asked on

createing a sub procedure

Hello experts,

I compleated this project and now my boss wants me to do this code in a sub procedure. Can anyone tell me or show me how to rewright this as a sub procedure.

Hawaii Dragon
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbperson.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a, b As Integer
        a = tbbill.Text
        b = tbtip.Text
        tbresult.Text = "Tip the " & tbperson.Text & " $" & FormatNumber(((a * b) / 100), 2)

    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PRIVATE SUB ProcedureName(ByVal Person As String, ByVal Bill As String, ByVal Tip As String)
tbresult.Text = "Tip the " & Person & " $" & FormatNumber(((Bill * Tip) / 100), 2)
END SUB
Avatar of HawaiiDragon
HawaiiDragon

ASKER

Thank you very much he approved with your changes.