Vb.net PictureBox的图像定位
我的代码遇到了一个问题 我的代码: 导入System.IO 公开课表格1 私有子按钮1\u单击ByVal发送者作为System.Object,ByVal e作为System.EventArgs处理按钮1。单击 将myPics暗显为新目录InfoF:\Documents and Settings\Adam\My Documents\My Pictures dimr作为新的随机变量 Dim i作为整数=r.NextmyPics.GetFiles.Length Dim Pics As FileInfo=myPics.GetFiles PictureBox1.ImageLocation=Picsi.FullName 端接头 末级 我得到一个错误: imagelocation不是windows.forms.picturebox的成员 我应该如何解决这个问题?谷歌: 在此编码中,Ctrl是控件引用,而不是PictureBox。因此,您需要将其转换为PictureBox引用Vb.net PictureBox的图像定位,vb.net,picturebox,Vb.net,Picturebox,我的代码遇到了一个问题 我的代码: 导入System.IO 公开课表格1 私有子按钮1\u单击ByVal发送者作为System.Object,ByVal e作为System.EventArgs处理按钮1。单击 将myPics暗显为新目录InfoF:\Documents and Settings\Adam\My Documents\My Pictures dimr作为新的随机变量 Dim i作为整数=r.NextmyPics.GetFiles.Length Dim Pics As FileInfo
If TypeOf ctrl Is PictureBox And ctrl.Name = PictureBoxName Then
Dim MyPictureBox as PictureBox
MyPictureBox = ctrl
MyPictureBox.Imagelocation = sFilename
MyPictureBox.SizeMode = PictureBoxSizeMode.StretchImage
End If