10-04-18, 02:48 AM
(09-04-18, 06:45 PM)ismail abdullah كتب :(08-04-18, 03:49 PM)رسول555 كتب :(08-04-18, 03:00 PM)tarek كتب : ضع كود عرض الصورة بين
Try catch
ممكن تطبيق الكود على المثال المرفق
=================================================================================================
هذا الكود ممكن تجربه أخي الكريم
كود :
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Try
Dim pos As Integer = BindingContext(dt).Position
PictureBox1.Image = bytetoimage(DataGridView1.Rows(pos).Cells("pictureimage").Value)
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Catch ex As Exception
MsgBox("لاتوجد صورة")
End Try
End Sub
شكرا لك اخي الكريم لقد تم التجربة بعد تعديل بسيط وهو فعال جدا ممتاز
كود :
private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Try
Dim pos As Integer = BindingContext(dt).Position
PictureBox1.Image = bytetoimage(DataGridView1.Rows(pos).Cells("pictureimage").Value)
Catch ex As Exception
MsgBox("لاتوجد صورة")
End Try
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
End Sub