代码以打印在文本框中输入的文本 [英] code to print text entered in textbox

查看:76
本文介绍了代码以打印在文本框中输入的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过打印机打印我的文本框文本",plz怎么建议一些代码plzzzz

i need to get printed my textbox "text" through printer how can is plz suggest some code plzzzz

推荐答案


如果您可以用Div包围文本框,那么这将是您的解决方案.

hi ,
if you can Surround your text box with Div this will be your solution .

<script language="javascript" type="text/javascript">
                function CallPrint(strid) {
                    var prtContent = document.getElementById(strid);
                    var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
                    WinPrint.document.write(prtContent.innerHTML);
                    WinPrint.document.close();
                    WinPrint.focus();
                    WinPrint.print();
                    WinPrint.close();
                    prtContent.innerHTML = strOldOne;
                }
</script>


<div id="bill">
<asp:textbox id="TextBox1" runat="server" textmode="MultiLine" height="224px" xmlns:asp="#unknown">
            style="margin-bottom: 136px" Width="320px"></asp:textbox>
</div>


<asp:button id="BtnPrint" runat="server" text="Print" onclientclick="javascript:CallPrint('bill');"  />
</div>



希望对您有帮助



Hope it help you


此线程 [
This thread[^] should help you.
This thread[^] too can be useful to you.


您可以看看这个

使用PrintDcument和PrintDialog从文本框中打印数据 [ ^ ]
You can have a look at this

Printing data from textboxes using PrintDcument and PrintDialog[^]


这篇关于代码以打印在文本框中输入的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆