打印列表框内容 [英] Print Listbox contents

查看:64
本文介绍了打印列表框内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



 功能 driverprint()
{
   var  textboxText = 文档 .getElementById(' <%= TextBox1.ClientID%>');
   var  ListBox1 = 文档 .getElementById(' <%= ListBox1.ClientID%>');
   var  windowUrl = '  about:空白' ;
   var  windowName = ' 打印' + 
  日期().getTime();
   var  printWindow = 窗口 .open(windowUrl,windowName,'   left = 50000,top = 50000,width = 0,height = 0');
  printWindow.文档 .write(textboxText.value);
  printWindow.文档 .write(ListBox1.value);

  printWindow. document  .close();
  printWindow.focus();
  printWindow.print();
  printWindow.close();
} 



正在打印文本框和列表框内容,现在问题是未打印ListBox1.value,我该如何解决?

解决方案

根据 http://codeabout.wordpress.com/2010/12/27 /print-from-a-listbox-using-c/ [function driverprint() { var textboxText = document.getElementById('<%= TextBox1.ClientID %>'); var ListBox1 = document.getElementById('<%= ListBox1.ClientID %>'); var windowUrl = 'about:blank'; var windowName = 'Print' + new Date().getTime(); var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0'); printWindow.document.write(textboxText.value); printWindow.document.write(ListBox1.value); printWindow.document.close(); printWindow.focus(); printWindow.print(); printWindow.close(); }



Am printing textbox and listbox contents, Now problem is ListBox1.value is not printed,How can i solve this?

解决方案

According to the documentation[^] the ListBox does not contain a Value property.


There''s a tutorial here, it solved my problem last year.
Please take a look:
http://codeabout.wordpress.com/2010/12/27/print-from-a-listbox-using-c/[^]


这篇关于打印列表框内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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