コードに問題が発生しています。
私のコード:
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
エラーが発生します:
imagelocationはwindows.forms.pictureboxのメンバーではありません
これをどのように修正すればよいですか?