
Berikut adalah cara memaparkan gambar(dalam picturebox) dari senarai (listbox). Menggunakan Visual Basic.NET Windows Application.
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
If ListBox1.SelectedIndex = 0 Then
PictureBox1.Load("c:\image1.jpg")
End If
If ListBox1.SelectedIndex = 1 Then
PictureBox1.Load("c:\image2.jpg")
End If
If ListBox1.SelectedIndex = 2 Then
PictureBox1.Load("c:\image3.jpg")
End If
'note: 3 image (di beri nama image1.jpg, image2.jpg dan image3.jpg ) di simpan dalam root c:
No comments:
Post a Comment