Dim txt As String = Functions.Execute("窗口表数据查找",Tables("文件管理"),e.Form.Controls("TextBox1").Text)
'执行查询
Tables("文件管理").Filter = txt
老师,我设置上面代码后为有下面的报错。
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.4.22.1
错误所在事件:窗口,文件管理,PictureBox1,BeforeGetImage
详细错误信息:
Object reference not set to an instance of an object.
下面是图片控件的代码。
Dim pic As WinForm.PictureBox = e.Sender
Dim wjm As String = Tables("文件管理").Current("文件")
If wjm.Contains(".") = False Then '若文件名不包含.,说明是未知文件
e.File = ProjectPath & "images/other.png"
Else
Dim i As Integer = wjm.LastIndexOf(".")
Dim kzm As String = wjm.SubString(i+1)
Dim kzms As String = "swf accdb mdb psd png xls xlsx bmp rar jpg doc docx zip pdf txt ppt exe" '定义已知扩展名
If kzms.Contains(kzm) = True Then
e.file = ProjectPath & "images/" & kzm & ".png"
Else
e.File = ProjectPath & "images/other.png"
End If
End If