我需要找到一种将字符串选择的抽认卡调用到新表单的方法,但我不知道如何传递它,因为我要做的是在单独的窗口中将单个抽认卡显示到表单中的标签中,代码在下面谢谢。
public void FlashcardDisplaylistbox_DoubleClick(object sender, MouseEventArgs e)
{
int index = this.FlashcardDisplaylistbox.IndexFromPoint(e.Location);
if (index != System.Windows.Forms.ListBox.NoMatches)
{
// when an item in listbox is double clicked it will execute this bit of code below
String selectedflashcard = FlashcardDisplaylistbox.SelectedItem.ToString();
MessageBox.Show(selectedflashcard);
MessageBox.Show(FlashcardDisplaylistbox.SelectedIndex.ToString());
int FlashcardID = (int)Flashcards.Rows[FlashcardDisplaylistbox.SelectedIndex][0]; // this section identifies the position of category the user clicks and converts it to a an integer
// the flashcardID will possibly be a way to remove the desired flashcard from the database
}
}