Monthly Archive: March 2011

Mar 24

Get return value from Invoke()

So you may wonder how to get a return value from a function that requires you to Invoke(). It’s actually quite simple. You’ll need another delegate type, here is an example of returning the key of a tabControls selected tab: public string CurrentTabKey() { if (tabControl.InvokeRequired) { return (string)tabControl.Invoke( new Func<String>(() => CurrentTabKey()) ); } …

Continue reading »