从数据库显示图片

时间:2016-04-07 12:02:38

标签: vb.net ms-access datagridview

我有一个datagridview,当我点击它时,它会打开另一个表格,其中包含datagridview内的信息。

enter image description here

在我的Access数据库中,我有一个带有图片(位图)的OLE对象,我想以info的形式显示它。

当我点击datagridview时,这是我必须获取信息的代码:

Private Sub DataGridView1_RowHeaderMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick

Dim curForm As Form = New Form
With curForm
info.TextBox1.Text = DataGridView1.SelectedRows(0).Cells(1).Value
info.TextBox2.Text = DataGridView1.SelectedRows(0).Cells(2).Value
info.TextBox3.Text = DataGridView1.SelectedRows(0).Cells(3).Value
info.TextBox4.Text = DataGridView1.SelectedRows(0).Cells(4).Value
info.TextBox5.Text = DataGridView1.SelectedRows(0).Cells(5).Value


info.Show()
End With

End Sub

0 个答案:

没有答案