BeforeAttachFile 事件代码
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "图片1"
If dr.IsNull("图片1名称") Then
MessageBox.Show("请先图片1!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
e.FileName = dr("图片1名称") & ".jpg"
End If
Case "图片2"
If dr.IsNull("图片2名称") Then
MessageBox.Show("请先图片2!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
e.FileName = dr("图片2名称") & ".jpg"
End If
Case "图片3"
If dr.IsNull("图片3名称") Then
MessageBox.Show("请先图片3!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
e.FileName = dr("图片3名称") & ".jpg"
End If
End Select