title: How to assign values to the delegate function in VB.NET
body: <p>I have a delegate function in another class, which is shown below</p>
  
  <pre><code>Public Class Connect
  
  Public Delegate Function RP_ClientConnect(ByVal hwndClient As IntPtr, _
                                          ByVal deviceID As Short, _
                                          ByVal protocol As String) As Short
  </code></pre>
  
  <p>I have a function in which I am trying to assign the values to the delegate function. But I am not sure of how to do that. I tried but couldn't able to resolve it.</p>
  
  <p>I am trying to pass the new values for deviceID and protocol in delegate function.         </p>
  
  <pre><code>Private Sub btnConnect_Click(sender As Object, e As EventArgs) Handles btnConnect.Click
  
  Dim myNewClientConnect As Connect
  Dim iDNumber as Integer= 10
  Dim prot as String = "CAN"
  myNewClientConnect(Nothing, iDNumber, prot)
  
  End Sub
  </code></pre>
  
  <p>I am new to vb.Net and expecting to get few suggestions from you people.</p>