因此,我有一个程序,我从该程序中从数据网格中检索数据并逐个遍历网格,但是当我Me.Hide
使用frmQuiz.Show
frmQuiz 表格,因此它最终出现在我上次留下的记录中。这是表单的 Load 事件中的代码
Private Sub frmQuiz_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
tracker = 0 'to keep track of which record to retrieve from datagrid,in this case the first
'TODO: This line of code loads data into the 'CompLitDataSet.tblQuestions' table. You can move, or remove it, as needed.
Me.TblQuestionsTableAdapter.Fill(Me.CompLitDataSet.tblQuestions)
hideGrid()
dgData.DataSource = TblQuestionsTableAdapter.GetAllUnsorted
Me.StartPosition = FormStartPosition.CenterParent 'load form at center screen
ReDim answers(TblQuestionsBindingSource.Count)
lblQuestion.Text = ""
lblQuestionNumber.Text = ""
PictureBox1.Visible = False
radA.Checked = False
radB.Checked = False
radC.Checked = False
radD.Checked = False
viewQuestions(0) 'show first questions
End Sub