Option Explicit On
Public Class Form1
Private Sub btnAdd_Click() Handles btnAdd.Click
' Define a lambda function that adds two integers.
Dim plus = Function(i1 As Integer, i2 As Integer) i1 + i2
' Get A and B.
Dim A As Integer = Integer.Parse(txtA.Text)
Dim B As Integer = Integer.Parse(txtB.Text)
' Call the lambda function to calculate the result.
txtResult.Text = plus(A, B).ToString
End Sub
End Class
Public Class Form1
Private Sub btnAdd_Click() Handles btnAdd.Click
' Define a lambda function that adds two integers.
Dim plus = Function(i1 As Integer, i2 As Integer) i1 + i2
' Get A and B.
Dim A As Integer = Integer.Parse(txtA.Text)
Dim B As Integer = Integer.Parse(txtB.Text)
' Call the lambda function to calculate the result.
txtResult.Text = plus(A, B).ToString
End Sub
End Class