首页 > 解决方案 > 在访问 PictureBox vb net 时显示/显示/检索图像(文件路径)

问题描述

我真的对这部分感到困惑。我可以用图片框保存5张图片,但只是图片所在的文件路径。现在我真的很困惑向图片框显示 5 张图片并打印它们。任何人都可以帮助我任何代码?我只需要代码来将我的图片显示到图片框但带有文件路径并打印它们。请帮助我:(我尝试使用此代码,但我不知道如何将图片检索到图片框

Private Sub search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles search.Click
  command.Connection = con
    command = New OleDbCommand("Select * from datagambar Where NoFaktur = '" & nofaktur.Text & "'")
    datareader = command.ExecuteReader
    datareader.Read()
    If datareader.HasRows Then
        PictureBox1.ImageLocation = datareader.Item("FakturInvoice") 'untuk mencari lokasi gambar pada direktori
        PictureBox2.ImageLocation = datareader.Item("SPB&BAPP")
        PictureBox3.ImageLocation = datareader.Item("PurchaseOrder")
        PictureBox4.ImageLocation = datareader.Item("TandaTerimaInvoice")
        PictureBox5.ImageLocation = datareader.Item("FakturPajak")
    Else
        MsgBox("There's No Image For NoFaktur '" & nofaktur.Text & "'")
    End If

标签: vb.netms-access

解决方案


推荐阅读