I am encountering a problem in my code.
My code:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myPics As New DirectoryInfo("F:\Documents and Settings\Adam\My Documents\My Pictures")
Dim r As New Random
Dim i As Integer = r.Next(myPics.GetFiles.Length)
Dim Pics() As FileInfo = myPics.GetFiles
PictureBox1.ImageLocation = Pics(i).FullName
End Sub
End Class
I get the error:
imagelocation not a member of windows.forms.picturebox
How should I fix this?