If MessageBox.Show("确定打印吗?","",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
Dim Pnl As WinForm.Panel = e.Form.Controls("Panel1")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(Pnl)
Dim ptime As Date = Date.Now
doc.Preview
Dim sp As TimeSpan = Date.now-ptime
If sp.TotalMilliseconds < 1000 Then
doc.Preview
End If
'msgbox(sp.TotalMilliseconds)
End If