Retun Value with Mouse Callback

Hi
Someone has an example about how to return values from Mouse Callback? For example onMouseUp return something?
I still have my problem with Delegate, handler Event and so on.
Thanks

Paolo

Hi @flecheria,

Here is a simple example:

public class TestMouseCallback : Rhino.UI.MouseCallback
{
  protected override void OnMouseMove(Rhino.UI.MouseCallbackEventArgs e)
  {
    // TODO...
    base.OnMouseMove(e);
  }

  protected override void OnMouseUp(Rhino.UI.MouseCallbackEventArgs e)
  {
    // TODO...
    base.OnMouseUp(e);
  }
}

...

var callback = new TestMouseCallback { Enabled = true };

As you can see, the event handlers do not return a value. But you can certainly call functions within the handler.

– Dale

1 Like

thanks Dale! Maybe this is the time that I finally master the Event in C#!