I need to use form2 to hold different text in the message box because I don't want to use a form for each button I have otherwise the application will have too much memory (please correct me if I'm wrong).
I need the form to display a MessageBox of text for each town of a city. The user clicks on a town which leads to form2. Form2 then has a button for "info" which opens up a messagebox of text. It will have other functions but I want to learn how to do this one first.
below i've got 2 buttons for 2 towns - lr is "La Reno" and ca is "carrera"
private void lr_Click(object sender, EventArgs e)
{
Form2 secondForm = new Form2();
secondForm.Show();
}
private void btnCa_Click(object sender, EventArgs e)
{
Form2 secondForm = new Form2();
secondForm.Show();
}
lr displays the same messagebox as ca when the info button is clicked on form2. I'd like lr to display different text in the messagebox whilst still being able to use the same form. If this isn't possible what's the alternative?
This post has been edited by Curtis Rutland: 28 September 2012 - 08:45 AM

New Topic/Question
Reply



MultiQuote







|