外部数据表“款式图”存有二进制图片,列字段为"SizeChImage",窗口“选择款”,在窗口新建了picturebox "PictureBox1",窗体内有外部数据表“鼎邦款式库”
需求:在窗体内外部数据表“鼎邦款式库”选择行的时候,通过 ElseIf Tables("选择款_鼎邦款式库").Current("ID") = Tables("款式图").Current("UPID") Then来显示对应外部数据表“款式图”的图片
将表“鼎邦款式库”的CurrentChanged事件代码设置为:
If Forms("选择款").Opened Then '如果窗口已经打开
Dim pbx As WinForm.PictureBox = Forms("选择款").Controls("PictureBox1")
If Tables("选择款_鼎邦款式库").Current Is Nothing Then
pbx.Image = Nothing
ElseIf Tables("选择款_鼎邦款式库").Current("ID") = Tables("款式图").Current("UPID") Then
pbx.Image = Tables("款式图").Current.DataRow.SQlLoadImage("SizeChImage") '从后台提取照片并显示
End If
End If
最后将窗口"选择款"的AfterLoad事件代码设置为:
Tables("款式图").RaiseCurrentChanged()
为什么图片会不显示?