I am trying to pass a string that is in a listbox to another form when it is double clicked. I have done this without issue multiple times in the past. However, on the second form when it is launched the string is blank.
Code:
Form passing string (Form5):
private void listBoxCurrentRentals_DoubleClick(object sender, EventArgs e)
{
selectedGame = listBoxCurrentRentals.SelectedItem.ToString();
Form17 reviewForm = new Form17();
reviewForm.Show();
}
Recieving form (Form17): game string is declared at the start of the code.
game = Form5.selectedGame;
textBoxGame.Text = game;
Thanks