我需要找到一种方法来将字符串选择的闪卡调用到一个新的形式,但我不知道如何通过它,因为我想要做的是在单独的窗口中将单独的闪卡显示到一个标签中表格,代码如下谢谢。
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
}
}