Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 11336

Imagens na listview

$
0
0
Boa tarde, Arranjei uma maneira melhor para por imagens na listview Partilho com vocês. Dim imgs As ImageList = New ImageList() imgs.ColorDepth = ColorDepth.Depth24Bit imgs.ImageSize = New Size(90, 80) Dim files As String() = New String() {} files = Directory.GetFiles(Application.StartupPath & "\imgimoveis\") Array.Reverse(files) For Each row As DataRow In sqlDatafile.Rows Dim id As String = row("IDimoveisVendidos").ToString Dim compara As String = Application.StartupPath & "\imgimoveis\" + row("IMG").ToString Dim Naoexisteimg As String = Nothing If row("IMG").ToString = Nothing Then imgs.Images.Add(Image.FromFile(Application.StartupPath & "\SYSTEM\nopic.jpg")) Else Dim ficheirocerto As String = Array.IndexOf(files, compara) If ficheirocerto <> Nothing Then If File.Exists(compara) Then imgs.Images.Add(Image.FromFile(files(ficheirocerto))) Else imgs.Images.Add(Image.FromFile(Application.StartupPath & "\SYSTEM\nopic.jpg")) End If End If End If Next

Viewing all articles
Browse latest Browse all 11336

Trending Articles