每次我想执行此代码(以新格式打开datagridview的内容)我收到此错误:
“参数无效”。
有代码:
Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
Try
info.TextBox1.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString()
info.TextBox2.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString()
info.TextBox3.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString()
info.TextBox4.Text = DataGridView1.CurrentRow.Cells(4).Value.ToString()
info.TextBox5.Text = DataGridView1.CurrentRow.Cells(5).Value.ToString()
Dim ms As New MemoryStream(CType(DataGridView1.CurrentRow.Cells(6).Value, Byte()))
info.PictureBox1.Image = Image.FromStream(ms)
Catch ex As Exception
MsgBox(ex.Message)
End Try
info.Show()
End Sub