Tag Archive: C#

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 »

Feb 23

Open links in default browser from WebBrowser control

If your looking to use C#’s web browser control but don’t want links to open in the same browser control (i.e. open them in a real browser like Chrome or Firefox), simply change the navigating handler to process the URL and fire the link in the diagnostics (which will open the URL in the user’s …

Continue reading »