I was trying to create a method which would produce “Adam” in the MessageBox with the title “The Title”. This code is not working. Is this because return can only return one value e.g. string name only? If I delete the title option it works fine. Any ideas would be great.
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(myMethod("Adam", "The Title"));
}
string myMethod(string name, string title)
{
return name, title;
}
}
}
Try this:
EDIT: To Show “The Title” on the texbox