Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Calling a function?

Tags:

c#

Hi i'm getting this error, do I have to add a special namespace? "The type or namespace name 'call' could not be found..."

private void start_btn_Click(object sender, EventArgs e)
{
    call DoIt();

}

void DoIt() 
{
    ...code
}
like image 576
acctman Avatar asked Jun 03 '26 00:06

acctman


2 Answers

Just invoke DoIt directly without call. There is no such operation as call in C#

DoIt();
like image 109
JaredPar Avatar answered Jun 05 '26 14:06

JaredPar


One doesn't use call to invoke a function in C#, so fix your code thus:

private void start_btn_Click(object sender, EventArgs e)
{
    DoIt();
}

As @Kheldar has suggested, you're probably thinking of the call statement in Visual Basic, which isn't a feature of C#.

like image 40
razlebe Avatar answered Jun 05 '26 14:06

razlebe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!