此主题相关图片如下:qwe.png

老师,我这个窗体默认的打开不让它显示数据,等查询后再显示查询结果
我现在实现 这个“打印”在没有点查询,查询结果出来之前,点“打印”的时候,提示先查询
打印的代码如下,可是不起作用,请老师指点
If Tables("零配件采购汇总_Table1").Current Is Nothing Then
MessageBox.Show("请先点查询","提示")
Return
Else
Dim pg As WinForm.SplitPanel = Forms("零配件采购汇总").Controls("SplitContainer1").Panel2
Dim doc As PrintDoc = e.Form.GernatePrintDoc(pg)
For Each c As object In Doc.Body.Children
If Typeof c Is prt.RenderTable Then
Dim t As prt.RenderTable = c
For i As Integer = 0 To t.Rows.count-1
For j As Integer = 0 To t.Cols.count-1
t.cells(i,j).Style.BackColor = Color.white
t.cells(i,j).Style.TextColor = Color.black
Next
Next
End If
Next
doc.Preview()
End If