title: Making a function wait for an event C#
body: <p>I have a class that creates an instance of a form with several buttons. I have a function in this class which is meant to wait for the user to click one of the buttons and return different values depending on which button was pressed. I've read some of the stuff on using anonymous delegates for this, but I'm not sure how I would determine which specific button was pressed. My original approach was to create a custom event that takes the button number as parameter, and tacking an event handler onto that from my class, but again I am not sure how I would have that function return anything once I get into a delegate.</p>
  
  <p>Is there any straightforward way of doing this?</p>
  
  <p>PM</p>