这样改一下
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter = "所有文件(*.*)|*.*" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ifo As new FileInfo(dlg.FileName)
Dim ids As Integer = 30720
If ifo.Length < ids Then
Dim se As WinForm.PictureBox = e.Form.Controls("图片名")
se.Image = GetImage(dlg.FileName)
Else
MessageBox.Show("不得超过300KB", "错误提示")
End If
End If