以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]确定打印后,怎么防止打印被取消?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87459)

--  作者:yinyb36
--  发布时间:2016/7/12 10:22:00
--  [求助]确定打印后,怎么防止打印被取消?
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)
    doc.Print()
End If
按回车键,确定打印后,有时会不注意按了两下回车,打印就被取消了,图片点击可在新窗口打开查看
怎么判断打印被取消?
或者怎么让打印不被取消?即按确定后,提示打印的窗口出来前,如果按回车就会被取消打印,那么怎么确保按回车键,打印不被取消?

--  作者:大红袍
--  发布时间:2016/7/12 10:48:00
--  

 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


--  作者:yinyb36
--  发布时间:2016/7/12 13:20:00
--  
图片点击可在新窗口打开查看   不是预览,是打印呀
--  作者:yinyb36
--  发布时间:2016/7/12 14:35:00
--  
if (window.event.keyCode==13) window.event.keyCode=0;  \'回车键无效....
在狐表中怎么实现?

--  作者:大红袍
--  发布时间:2016/7/12 14:43:00
--  
 一样啊,改成print就行啊。
--  作者:yinyb36
--  发布时间:2016/7/12 15:38:00
--  
无限打印
--  作者:大红袍
--  发布时间:2016/7/12 15:41:00
--  

 这句代码改成你适当的数值啊,默认是1秒啊

 

If sp.TotalMilliseconds < 1000 Then


--  作者:yinyb36
--  发布时间:2016/7/12 16:38:00
--  
晕,这是考验电脑的反应速度吗?
少了判断条件,是否取消了添加打印机的打印进程


--  作者:大红袍
--  发布时间:2016/7/12 16:41:00
--  

 那没办法。


--  作者:yinyb36
--  发布时间:2016/7/12 16:48:00
--  
有没有办法让回车键失效的命令,打印后再让回车键可用