منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مشكلة كل ماأعرض الصور يتم عرض الصور التي قبلها دون افراغ listview ماهو السبب
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
ياجماعة ماهي المشكلة كل ماأعرض الصور يتم عرض الصور التي قبلها دون افراغ listview ماهو السبب 
كود :
 Dim imglist As New ImageList
       imglist.Images.Clear()
       ListView1.Items.Clear()
       imglist.ColorDepth = ColorDepth.Depth32Bit
       ListView1.LargeImageList = imglist
       ListView1.LargeImageList.ImageSize = New System.Drawing.Size(200, 200)
       con.Close()
       If con.State = ConnectionState.Closed Then con.Open()
       Dim strsql As String = "SELECT dbo.pictures.Nu_pic, dbo.FilePictures.Num_File, dbo.FilePictures.Num_pic, dbo.pictures.pic,dbo.Files.Num_file  FROM dbo.FilePictures INNER JOIN dbo.Files ON dbo.FilePictures.Num_File = dbo.Files.No_Genfile INNER JOIN  dbo.pictures ON dbo.FilePictures.Num_pic = dbo.pictures.Nu_pic where dbo.Files.Num_file=" & Text_NoFile.Text
       Dim dt_images As New DataTable
       cmd.Connection = con
       cmd.CommandText = strsql
       adp.SelectCommand = cmd
       adp.Fill(ds)
       For Each dr As DataRow In ds.Tables(0).Rows
           Dim imb_buffer = CType(dr("pic"), Byte())
           Dim img_stream As New IO.MemoryStream(imb_buffer, True)
           img_stream.Write(imb_buffer, 0, imb_buffer.Length)
           imglist.Images.Add(dr("Nu_pic").ToString(), New Bitmap(img_stream))
           img_stream.Close()
           Dim lsvparent As New ListViewItem
           'lsvparent.Text = dr("pic").ToString
           lsvparent.ImageKey = dr("Nu_pic").ToString
           ListView1.Items.Add(lsvparent)
           lsvparent.Text = imglist.Images.Count.ToString
       Next
       con.Close()
السبب بسيط جدا راجع ترتيب الكود تبعك على حسب الامر لاني راجعت الكود بتاعك مافهوش غلط وانت تعرف ان vb.nبيتعرف على الاوامر حسب ترتيب الكود .