title: VB.NET: How can I have events return a value like I can in C#?
body: <p>In C#, I can do this:</p>
  
  <pre><code>public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          Class1 c1 = new Class1();
  
          c1.OnNeedInt += new Class1.NeedInt(c1_OnNeedInt);
  
          int i = c1.GetInt();
      }
  
      int c1_OnNeedInt()
      {
          return 1;
      }
  }
  
  public class Class1
  {
      public delegate int NeedInt();
      public event NeedInt OnNeedInt;
  
      public int GetInt()
      {
          return OnNeedInt == null ? 0 : OnNeedInt();
      }
  }
  </code></pre>
  
  <p>Notice the line <code>int i = c1.GetInt();</code>.  I can't seem to get VB.NET 4.0 to do something similiar.  Any help?</p>