I am having problems calling a method in C#, I keep getting the message “Method (calculate) must have a return type”.
using System.Diagnostics;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
public class Hello : Form
{
public string test { get; set; }
calculate();
}
public class Hello2 : Form
{
public void calculate()
{
Process.Start("test.exe");
}
}
calculate();is an invalid method signature in yourHelloclass. It is missing the return type and it also needs a body.At a minimum the signature should look like: