Consider:
namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent();
Your method must be static
static void setTextboxText(int result) { if (this.InvokeRequired) { this.Invoke(new IntDelegate(SetTextboxTextSafe), new object[] { result }); } else { SetTextboxTextSafe(result); } }