Action(T1, T2) Delegate represents a method that has two parameters and does not return a value. : Action « Language Basics « VB.Net






Action(T1, T2) Delegate represents a method that has two parameters and does not return a value.

 

Imports System.IO

Delegate Sub ConcatStrings(string1 As String, string2 As String)

Module TestDelegate
   Public Sub Main()

      Dim message1 As String = "The first line of a message."
      Dim message2 As String = "The second line of a message."
      Dim concat As ConcatStrings

      concat = AddressOf WriteToConsole
      concat(message1, message2)         
   End Sub

   Private Sub WriteToConsole(string1 As String, string2 As String)
      Console.WriteLine("{0}{1}{2}", string1, vbCrLf, string2)
   End Sub
End Module

   
  








Related examples in the same category

1.Action Delegate encapsulates a method that has no parameters and does not return a value.