winforms - BeginInvoke() giving errors in my C# code -


i trying implement begininvoke() in code , came across part throwing error.

 private void showpiclensplot()         {             if (piclensplot.invokerequired)             {                 piclensplot.begininvoke(new action<control, bool>(showpiclensplot, piclensplot, true));             }             else             {                 piclensplot.bringtofront();             }         } 

the error methodname expected above source code has been converted c# vb , online tool used to this. piclensplot private system.windows.forms.picturebox piclensplot;

this should work:

if (piclensplot.invokerequired) {     piclensplot.begininvoke(new action(() => showpiclensplot())); } else {     piclensplot.bringtofront(); } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -