使用mshtml为html文件写入数据[代码]

最近要做的一个界面,由于数据太多且涉及到多个主子关联的表,朋友说用四个DataGrid绑定数据并实现与查询条件的联动,太麻烦而且界面肯定不好看,我用mshtml改造成这样了。

 


mshtml1.gif 

未加载数据的窗体

mshtml2.gif

加载数据后的窗体


步骤:1)用Macromedia Dreamweaver生成一个名为fsallcondition.htm的html文件,源码如下:
 

None.gif <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
None.gif"http://www.w3.org/TR/html4/loose.dtd"
>
None.gif
< html >
None.gif
< head >
None.gif
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312" >
None.gif
< title > 废水排放情况统计 </ title >
ExpandedBlockStart.gifContractedBlock.gif
< style  type ="text/css" > dot.gif
InBlock.gif<!--
ExpandedSubBlockStart.gifContractedSubBlock.gifbody 
{dot.gif}{
InBlock.gif    margin-left
: 0px;
InBlock.gif    margin-top
: 0px;
InBlock.gif    margin-right
: 0px;
InBlock.gif    margin-bottom
: 0px;
ExpandedSubBlockEnd.gif
}

ExpandedBlockEnd.gif-->
None.gif
</ style >
None.gif
< script  language ="JavaScript"  src ="../includes/js/common.js" ></ script >
None.gif
ExpandedBlockStart.gifContractedBlock.gif
< script  language ="javascript" > dot.gif
InBlock.gif  
function printsetup()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif      
// 打印页面设置
InBlock.gif
        wb.execwb(8,1);
ExpandedSubBlockEnd.gif  }

InBlock.gif  
function printpreview()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif      
// 打印页面预览
InBlock.gif
      wb.execwb(7,1);  
ExpandedSubBlockEnd.gif  }

InBlock.gif  
function printit()
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif      
if (confirm('您确定要打印本文档吗?')) 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            wb.execwb(
6,6);
ExpandedSubBlockEnd.gif        }

ExpandedBlockEnd.gif  }

None.gif
</ script >
None.gif
< link  href ="../includes/css/main.css"  rel ="stylesheet"  type ="text/css" >
None.gif
</ head >
None.gif
None.gif
< body >
None.gif
< OBJECT  classid ="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"  height =0  id =wb  name =wb  width =0></OBJECT>
None.gif
<table width ="100%"  height ="100%"   border ="0"  cellpadding ="0"  cellspacing ="0" >
None.gif  
< tr >
None.gif    
< td  align ="center"  valign ="top" >< table  width ="80%"   border ="0"  cellspacing ="0"  cellpadding ="0" >
None.gif      
< tr >
None.gif        
< td  width ="56%" >< br >
None.gif          
< br >< table  width ="806px"   border ="0"  cellpadding ="0"  cellspacing ="0"  class ="tableborder" >
None.gif          
< tr >
None.gif            
< td  width ="83"  class ="tdrbborder" > &nbsp; 排污口编号 </ td >
None.gif            
< td  id ="pwkbh"  width ="107"  class ="tdrbborder" > &nbsp; </ td >
None.gif            
< td  width ="85"  class ="tdrbborder" > &nbsp; 排污口名称 </ td >
None.gif            
< td  id ="pwkmc"  width ="120"  class ="tdrbborder" > &nbsp; </ td >
None.gif            
< td  width ="77"  class ="tdrbborder" > &nbsp; 排污口位置 </ td >
None.gif            
< td  id ="pwkwz"  width ="136"  class ="tdrbborder" > &nbsp; </ td >
None.gif            
< td  width ="77"  class ="tdrbborder" > &nbsp; 排放去向 </ td >
None.gif            
< td  id ="pfqx"  width ="120"  class ="tdbborder" > &nbsp; </ td >
None.gif          
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  class ="tdrbborder" > &nbsp; 接纳水体类别 </ td >
None.gif            
< td  id ="jnstlb"  class ="tdrbborder" > &nbsp; </ td >
None.gif            
< td  colspan ="2"  class ="tdrbborder" > &nbsp; 新建项目名称及建设日期 </ td >
None.gif            
< td  id ="xjxmmcjjsrq"  colspan ="4"  class ="tdbborder" > &nbsp; </ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  class ="tdrbborder" > &nbsp; 监控仪器 </ td >
None.gif            
< td  id ="jkyq"  colspan ="7"  class ="tdbborder" > &nbsp; </ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  class ="tdrbborder" > &nbsp; 执行标准 </ td >
None.gif            
< td  id ="zxbz"  colspan ="7"  class ="tdbborder" > &nbsp; </ td >
None.gif            
</ tr >
None.gif          
< tr  class ="tdbborder" >
None.gif            
< td  id ="pwkzxbz"  colspan ="8"  class ="tdbborder" > &nbsp; < strong > 排污口执行标准: </ strong >< br >< br >
None.gif              
None.gif            
</ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  colspan ="8" >< br >
None.gif              
&nbsp; < strong > 允许排放量: &nbsp;&nbsp;&nbsp; </ strong >
None.gif              
< div  id ="pwxkzbh"  style ="width:200px; line-height:18pt; font:9pt" > &nbsp;&nbsp; [排污许可证编号——] </ div ></ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  colspan ="8"  class ="tdbborder" >< table  id ="tblYXPFL"  width ="90%"   border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0"  class ="tabletbborder" >
None.gif              
< tr >
None.gif                
< td  width ="20%"  class ="tdrbborder" > &nbsp; 污水允许排放量 </ td >
None.gif                
< td  width ="27%"  class ="tdrbborder" > &nbsp; 污染物 </ td >
None.gif                
< td  width ="26%"  class ="tdrbborder" > &nbsp; 许可浓度 </ td >
None.gif                
< td  width ="27%"  class ="tdbborder" > &nbsp; 许可排放量 </ td >
None.gif              
</ tr >
None.gif            
</ table >
None.gif              
< br ></ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  colspan ="5"  valign ="top" >< br >
None.gif              
&nbsp; < strong > 污水排放情况: </ strong >
None.gif              
< div  id ="pfzl"  style ="width:200px; line-height:18pt; font:9pt" > &nbsp;&nbsp; [排放总量——] </ div ></ td >
None.gif            
< td  colspan ="3"  valign ="top" >< br >
None.gif              
&nbsp; < strong > 指标监测情况: </ strong ></ td >
None.gif            
</ tr >
None.gif          
< tr  class ="font9" >
None.gif            
< td  colspan ="5"  valign ="top" >< table  width ="95%"   border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0"  class ="tabletbborder" >
None.gif              
< tr >
None.gif                
< td  width ="28%"  class ="tdrbborder" > &nbsp; 污染物 </ td >
None.gif                
< td  width ="16%"  class ="tdrbborder" > &nbsp; 实际浓度 </ td >
None.gif                
< td  width ="17%"  class ="tdrbborder" > &nbsp; 达标排放量 </ td >
None.gif                
< td  width ="17%"  class ="tdrbborder" > &nbsp; 超标排放量 </ td >
None.gif                
< td  width ="22%"  class ="tdbborder" > &nbsp; 合计 </ td >
None.gif              
</ tr >
None.gif              
< tr >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif              
</ tr >
None.gif            
</ table >
None.gif            
< br ></ td >
None.gif            
< td  colspan ="3"  valign ="top" >< table  width ="95%"   border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0"  class ="tabletbborder" >
None.gif              
< tr >
None.gif                
< td  width ="48%"  class ="tdrbborder" > &nbsp; 污染物 </ td >
None.gif                
< td  width ="22%"  class ="tdrbborder" > &nbsp; 检测浓度 </ td >
None.gif                
< td  width ="30%"  class ="tdbborder" > &nbsp; 检测标准浓度 </ td >
None.gif              
</ tr >
None.gif              
< tr >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif                
< td > &nbsp; </ td >
None.gif              
</ tr >
None.gif            
</ table >< br ></ td >
None.gif            
</ tr >
None.gif        
</ table ></ td >
None.gif        
</ tr >
None.gif      
< tr >
None.gif        
< td > &nbsp; </ td >
None.gif        
</ tr >
None.gif      
< tr >
None.gif        
< td > &nbsp; </ td >
None.gif        
</ tr >
None.gif    
</ table ></ td >
None.gif  
</ tr >
None.gif
</ table >
None.gif
</ body >
None.gif
</ html >
None.gif

关键是:为每个数据区域(Td和Div)定义一个ID,以便在程序中进行引用。

2)建立WinForm窗体,引用Microsoft.mshtml,使用Microsoft Web浏览器加载html文件,"查询"按钮用于调用向html文件中写数据的过程,"页面设置"、"打印预览"及"打印"按钮用以调用html文件中的javascript完成相应的功能。源码如下:

None.gif using  System;
None.gif
using  System.Drawing;
None.gif
using  System.Collections;
None.gif
using  System.ComponentModel;
None.gif
using  System.Windows.Forms;
None.gif
None.gif
namespace  HC.WinForm
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
/// frm_废水所有信息 的摘要说明。
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class frm_废水所有信息 : System.Windows.Forms.Form
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private System.Windows.Forms.Panel panel1;
InBlock.gif        
private System.Windows.Forms.Label label1;
InBlock.gif        
private System.Windows.Forms.ComboBox cmbPWK;
InBlock.gif        
private System.Windows.Forms.DateTimePicker dateTimePicker1;
InBlock.gif        
private System.Windows.Forms.Label label2;
InBlock.gif        
private System.Windows.Forms.Label label3;
InBlock.gif        
private System.Windows.Forms.RadioButton radYear;
InBlock.gif        
private System.Windows.Forms.RadioButton radMonth;
InBlock.gif        
private System.Windows.Forms.Label label4;
InBlock.gif        
private System.Windows.Forms.Button btnQuery;
InBlock.gif        
private System.Windows.Forms.Button btnExit;
InBlock.gif        
private AxSHDocVw.AxWebBrowser awbMain;
InBlock.gif        
private System.Windows.Forms.Button button3;
InBlock.gif        
private System.Windows.Forms.Button btnPS;
InBlock.gif        
private System.Windows.Forms.Button btnPP;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 必需的设计器变量。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private System.ComponentModel.Container components = null;
InBlock.gif
InBlock.gif        [STAThread]
InBlock.gif        
static void Main() 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            Application.Run(
new frm_废水所有信息());
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//单位编号
InBlock.gif
        private string strunit = "";
InBlock.gif
InBlock.gif        
//计数器,记录页面加载的次数
InBlock.gif
        private int intLoadTimes = 0;
InBlock.gif
InBlock.gif        
public string strUnit
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this.strunit;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this.strunit = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private mshtml.IHTMLDocument2 doc = null;
InBlock.gif
InBlock.gif        
private System.Runtime.InteropServices.Expando.IExpando ex;
InBlock.gif
InBlock.gif        
private mshtml.IHTMLWindow2 win = null;
InBlock.gif
InBlock.gif
InBlock.gif        
public frm_废水所有信息()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//
InBlock.gif            
// Windows 窗体设计器支持所必需的
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif
InBlock.gif            
//
InBlock.gif            
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
InBlock.gif            
//
ExpandedSubBlockEnd.gif
        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 清理所有正在使用的资源。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected override void Dispose( bool disposing )
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if( disposing )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if(components != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    components.Dispose();
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
base.Dispose( disposing );
ExpandedSubBlockEnd.gif        }

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
InBlock.gif        
/// 此方法的内容。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            System.Resources.ResourceManager resources 
= new System.Resources.ResourceManager(typeof(frm_废水所有信息));
InBlock.gif            
this.panel1 = new System.Windows.Forms.Panel();
InBlock.gif            
this.button3 = new System.Windows.Forms.Button();
InBlock.gif            
this.btnPP = new System.Windows.Forms.Button();
InBlock.gif            
this.btnPS = new System.Windows.Forms.Button();
InBlock.gif            
this.btnExit = new System.Windows.Forms.Button();
InBlock.gif            
this.btnQuery = new System.Windows.Forms.Button();
InBlock.gif            
this.label4 = new System.Windows.Forms.Label();
InBlock.gif            
this.radMonth = new System.Windows.Forms.RadioButton();
InBlock.gif            
this.radYear = new System.Windows.Forms.RadioButton();
InBlock.gif            
this.label3 = new System.Windows.Forms.Label();
InBlock.gif            
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
InBlock.gif            
this.cmbPWK = new System.Windows.Forms.ComboBox();
InBlock.gif            
this.label1 = new System.Windows.Forms.Label();
InBlock.gif            
this.label2 = new System.Windows.Forms.Label();
InBlock.gif            
this.awbMain = new AxSHDocVw.AxWebBrowser();
InBlock.gif            
this.panel1.SuspendLayout();
InBlock.gif            ((System.ComponentModel.ISupportInitialize)(
this.awbMain)).BeginInit();
InBlock.gif            
this.SuspendLayout();
InBlock.gif            
// 
InBlock.gif            
// panel1
InBlock.gif            
// 
InBlock.gif
            this.panel1.BackColor = System.Drawing.Color.White;
InBlock.gif            
this.panel1.Controls.Add(this.button3);
InBlock.gif            
this.panel1.Controls.Add(this.btnPP);
InBlock.gif            
this.panel1.Controls.Add(this.btnPS);
InBlock.gif            
this.panel1.Controls.Add(this.btnExit);
InBlock.gif            
this.panel1.Controls.Add(this.btnQuery);
InBlock.gif            
this.panel1.Controls.Add(this.label4);
InBlock.gif            
this.panel1.Controls.Add(this.radMonth);
InBlock.gif            
this.panel1.Controls.Add(this.radYear);
InBlock.gif            
this.panel1.Controls.Add(this.label3);
InBlock.gif            
this.panel1.Controls.Add(this.dateTimePicker1);
InBlock.gif            
this.panel1.Controls.Add(this.cmbPWK);
InBlock.gif            
this.panel1.Controls.Add(this.label1);
InBlock.gif            
this.panel1.Controls.Add(this.label2);
InBlock.gif            
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
InBlock.gif            
this.panel1.Location = new System.Drawing.Point(00);
InBlock.gif            
this.panel1.Name = "panel1";
InBlock.gif            
this.panel1.Size = new System.Drawing.Size(85048);
InBlock.gif            
this.panel1.TabIndex = 0;
InBlock.gif            
// 
InBlock.gif            
// button3
InBlock.gif            
// 
InBlock.gif
            this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
InBlock.gif            
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
InBlock.gif            
this.button3.Location = new System.Drawing.Point(71213);
InBlock.gif            
this.button3.Name = "button3";
InBlock.gif            
this.button3.Size = new System.Drawing.Size(5623);
InBlock.gif            
this.button3.TabIndex = 5;
InBlock.gif            
this.button3.Text = "打印(&P)";
InBlock.gif            
this.button3.Click += new System.EventHandler(this.button3_Click);
InBlock.gif            
// 
InBlock.gif            
// btnPP
InBlock.gif            
// 
InBlock.gif
            this.btnPP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
InBlock.gif            
this.btnPP.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
InBlock.gif            
this.btnPP.Location = new System.Drawing.Point(64013);
InBlock.gif            
this.btnPP.Name = "btnPP";
InBlock.gif            
this.btnPP.Size = new System.Drawing.Size(6423);
InBlock.gif            
this.btnPP.TabIndex = 4;
InBlock.gif            
this.btnPP.Text = "打印预览";
InBlock.gif            
this.btnPP.Click += new System.EventHandler(this.btnPP_Click);
InBlock.gif            
// 
InBlock.gif            
// btnPS
InBlock.gif            
// 
InBlock.gif
            this.btnPS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
InBlock.gif            
this.btnPS.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
InBlock.gif            
this.btnPS.Location = new System.Drawing.Point(56813);
InBlock.gif            
this.btnPS.Name = "btnPS";
InBlock.gif            
this.btnPS.Size = new System.Drawing.Size(6423);
InBlock.gif            
this.btnPS.TabIndex = 3;
InBlock.gif            
this.btnPS.Text = "页面设置";
InBlock.gif            
this.btnPS.Click += new System.EventHandler(this.btnPS_Click);
InBlock.gif            
// 
InBlock.gif            
// btnExit
InBlock.gif            
// 
InBlock.gif
            this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
InBlock.gif            
this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
InBlock.gif            
this.btnExit.Location = new System.Drawing.Point(77613);
InBlock.gif            
this.btnExit.Name = "btnExit";
InBlock.gif            
this.btnExit.Size = new System.Drawing.Size(5623);
InBlock.gif            
this.btnExit.TabIndex = 6;
InBlock.gif            
this.btnExit.Text = "退出(&X)";
InBlock.gif            
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
InBlock.gif            
// 
InBlock.gif            
// btnQuery
InBlock.gif            
// 
InBlock.gif
            this.btnQuery.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
InBlock.gif            
this.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
InBlock.gif            
this.btnQuery.Location = new System.Drawing.Point(50413);
InBlock.gif            
this.btnQuery.Name = "btnQuery";
InBlock.gif            
this.btnQuery.Size = new System.Drawing.Size(5623);
InBlock.gif            
this.btnQuery.TabIndex = 2;
InBlock.gif            
this.btnQuery.Text = "查询(&Q)";
InBlock.gif            
this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
InBlock.gif            
// 
InBlock.gif            
// label4
InBlock.gif            
// 
InBlock.gif
            this.label4.Location = new System.Drawing.Point(44816);
InBlock.gif            
this.label4.Name = "label4";
InBlock.gif            
this.label4.Size = new System.Drawing.Size(3216);
InBlock.gif            
this.label4.TabIndex = 7;
InBlock.gif            
this.label4.Text = "查询";
InBlock.gif            
// 
InBlock.gif            
// radMonth
InBlock.gif            
// 
InBlock.gif
            this.radMonth.Checked = true;
InBlock.gif            
this.radMonth.Location = new System.Drawing.Point(41612);
InBlock.gif            
this.radMonth.Name = "radMonth";
InBlock.gif            
this.radMonth.Size = new System.Drawing.Size(3224);
InBlock.gif            
this.radMonth.TabIndex = 6;
InBlock.gif            
this.radMonth.TabStop = true;
InBlock.gif            
this.radMonth.Text = "";
InBlock.gif            
// 
InBlock.gif            
// radYear
InBlock.gif            
// 
InBlock.gif
            this.radYear.Location = new System.Drawing.Point(38412);
InBlock.gif            
this.radYear.Name = "radYear";
InBlock.gif            
this.radYear.Size = new System.Drawing.Size(3224);
InBlock.gif            
this.radYear.TabIndex = 5;
InBlock.gif            
this.radYear.Text = "";
InBlock.gif            
// 
InBlock.gif            
// label3
InBlock.gif            
// 
InBlock.gif
            this.label3.Location = new System.Drawing.Point(36816);
InBlock.gif            
this.label3.Name = "label3";
InBlock.gif            
this.label3.Size = new System.Drawing.Size(1616);
InBlock.gif            
this.label3.TabIndex = 4;
InBlock.gif            
this.label3.Text = "";
InBlock.gif            
// 
InBlock.gif            
// dateTimePicker1
InBlock.gif            
// 
InBlock.gif
            this.dateTimePicker1.Location = new System.Drawing.Point(23214);
InBlock.gif            
this.dateTimePicker1.Name = "dateTimePicker1";
InBlock.gif            
this.dateTimePicker1.Size = new System.Drawing.Size(12021);
InBlock.gif            
this.dateTimePicker1.TabIndex = 1;
InBlock.gif            
// 
InBlock.gif            
// cmbPWK
InBlock.gif            
// 
InBlock.gif
            this.cmbPWK.Location = new System.Drawing.Point(6414);
InBlock.gif            
this.cmbPWK.Name = "cmbPWK";
InBlock.gif            
this.cmbPWK.Size = new System.Drawing.Size(12120);
InBlock.gif            
this.cmbPWK.TabIndex = 0;
InBlock.gif            
this.cmbPWK.Text = "comboBox1";
InBlock.gif            
// 
InBlock.gif            
// label1
InBlock.gif            
// 
InBlock.gif
            this.label1.Location = new System.Drawing.Point(1616);
InBlock.gif            
this.label1.Name = "label1";
InBlock.gif            
this.label1.Size = new System.Drawing.Size(6416);
InBlock.gif            
this.label1.TabIndex = 0;
InBlock.gif            
this.label1.Text = "排污口";
InBlock.gif            
// 
InBlock.gif            
// label2
InBlock.gif            
// 
InBlock.gif
            this.label2.Location = new System.Drawing.Point(20016);
InBlock.gif            
this.label2.Name = "label2";
InBlock.gif            
this.label2.Size = new System.Drawing.Size(6416);
InBlock.gif            
this.label2.TabIndex = 3;
InBlock.gif            
this.label2.Text = "年月";
InBlock.gif            
// 
InBlock.gif            
// awbMain
InBlock.gif            
// 
InBlock.gif
            this.awbMain.Dock = System.Windows.Forms.DockStyle.Fill;
InBlock.gif            
this.awbMain.Enabled = true;
InBlock.gif            
this.awbMain.Location = new System.Drawing.Point(048);
InBlock.gif            
this.awbMain.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("awbMain.OcxState")));
InBlock.gif            
this.awbMain.Size = new System.Drawing.Size(850408);
InBlock.gif            
this.awbMain.TabIndex = 1;
InBlock.gif            
this.awbMain.DocumentComplete += new AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.awbMain_DocumentComplete);
InBlock.gif            
// 
InBlock.gif            
// frm_废水所有信息
InBlock.gif            
// 
InBlock.gif
            this.AutoScaleBaseSize = new System.Drawing.Size(614);
InBlock.gif            
this.ClientSize = new System.Drawing.Size(850456);
InBlock.gif            
this.Controls.Add(this.awbMain);
InBlock.gif            
this.Controls.Add(this.panel1);
InBlock.gif            
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
InBlock.gif            
this.Name = "frm_废水所有信息";
InBlock.gif            
this.Text = "废水所有信息统计";
InBlock.gif            
this.Load += new System.EventHandler(this.frm_废水所有信息_Load);
InBlock.gif            
this.panel1.ResumeLayout(false);
InBlock.gif            ((System.ComponentModel.ISupportInitialize)(
this.awbMain)).EndInit();
InBlock.gif            
this.ResumeLayout(false);
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 为cmbPWK绑定数据
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void SetUnitCombo()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strSQL = "SELECT 排污口编号, 排污口名称 FROM [PW_废水排污口] WHERE (所属单位 = '" + this.strUnit + "') ORDER BY 排污口编号";
InBlock.gif
InBlock.gif            System.Data.DataSet dsUnit 
= HEWin.Sys.sysDb.GetDataSetBySql(strSQL, "废水排污口");
InBlock.gif
InBlock.gif            
this.cmbPWK.DataSource = dsUnit.Tables["废水排污口"];
InBlock.gif
InBlock.gif            
this.cmbPWK.DisplayMember = "排污口名称";
InBlock.gif
InBlock.gif            
this.cmbPWK.ValueMember = "排污口编号";
InBlock.gif
InBlock.gif            dsUnit.Dispose();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 排污口基本情况,最多只有一行数据
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private string SetBasicInfo()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strRet = "";
InBlock.gif
InBlock.gif            
string strSQL = "SELECT 排污口编号, 排污口名称, 排污口位置, 排放去向, 排放标准, 接纳水体功能类别 AS 接纳水体类别, 最近建设项目名称及建设日期 AS 新建项目名称及建设日期, 监控仪器, 执行标准 FROM [CX_排污口基本情况] WHERE (排污口编号 = '" + this.cmbPWK.SelectedValue.ToString() + "')";
InBlock.gif
InBlock.gif            System.Data.DataSet dsBasicInfo 
= HEWin.Sys.sysDb.GetDataSetBySql(strSQL, "排污口基本情况");
InBlock.gif
InBlock.gif            
if (dsBasicInfo.Tables["排污口基本情况"].Rows.Count == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this.win.execScript("showMD(\"环境检测管理系统\", \"errnounit.htm\", true, false, false)""javascript");
InBlock.gif                
return strRet;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            strRet 
= dsBasicInfo.Tables["排污口基本情况"].Rows[0]["排放标准"].ToString();
InBlock.gif
InBlock.gif            mshtml.IHTMLElement2 eleTd 
= (mshtml.IHTMLElement2)doc.all.item("pwkbh"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["排污口编号"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("pwkmc"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["排污口名称"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("pwkwz"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["排污口位置"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("pfqx"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["排放去向"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("jnstlb"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["接纳水体类别"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("xjxmmcjjsrq"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["新建项目名称及建设日期"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("jkyq"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["监控仪器"].ToString() + "</font>";
InBlock.gif
InBlock.gif            eleTd 
= (mshtml.IHTMLElement2)doc.all.item("zxbz"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= "&nbsp;<font color='blue'>" + dsBasicInfo.Tables["排污口基本情况"].Rows[0]["执行标准"].ToString() + "</font>";
InBlock.gif
InBlock.gif            dsBasicInfo.Dispose();
InBlock.gif
InBlock.gif            eleTd 
= null;
InBlock.gif
InBlock.gif            
return strRet;
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 执行标准
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="执行标准"></param>

InBlock.gif        private void SetExecStandard(string 执行标准)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
InBlock.gif            
if (执行标准 == "")
InBlock.gif                
return;
InBlock.gif
InBlock.gif            
string strSQL = "SELECT 执行标准编号, 执行标准 FROM [CX_废水执行标准] WHERE (执行标准编号 = '" + 执行标准 + "')";
InBlock.gif
InBlock.gif            
string strIH = "&nbsp;<strong>排污口执行标准:</strong><br><center><font color='blue'>";
InBlock.gif            
InBlock.gif            System.Data.DataSet dsES 
= HEWin.Sys.sysDb.GetDataSetBySql(strSQL, "废水执行标准");
InBlock.gif
InBlock.gif            
if (dsES.Tables["废水执行标准"].Rows.Count == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strIH 
+= "无执行标准";    
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
for(int i = 0; i < dsES.Tables["废水执行标准"].Rows.Count; i ++)
InBlock.gif                    strIH 
+= dsES.Tables["废水执行标准"].Rows[i]["执行标准"].ToString().Replace(" ""&nbsp;"+ "<br>";
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            strIH 
+= "</font></center>";
InBlock.gif
InBlock.gif            mshtml.IHTMLElement2 eleTd 
= (mshtml.IHTMLElement2)doc.all.item("pwkzxbz"null);
InBlock.gif
InBlock.gif            ((mshtml.HTMLTableCellClass)eleTd).innerHTML 
= strIH;
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 允许排放量
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void SetYXPFL()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strSQL = "SELECT 许可证编号, 污水允许排放量, 污染物, 许可浓度, 许可排放量 FROM [CX_废水允许排放量] WHERE (排污口编号 = '" + this.cmbPWK.SelectedValue.ToString() + "') ORDER BY 污染物";
InBlock.gif
InBlock.gif            System.Data.DataSet dsYXPFL 
= HEWin.Sys.sysDb.GetDataSetBySql(strSQL, "允许排放量");
InBlock.gif
InBlock.gif            
string strScript = "";
InBlock.gif
InBlock.gif            mshtml.IHTMLElement2 eleDiv 
= (mshtml.IHTMLElement2)doc.all.item("pwxkzbh"null);
InBlock.gif
InBlock.gif            
if (dsYXPFL.Tables["允许排放量"].Rows.Count == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
//没有污水允许排放量时的处理
InBlock.gif

InBlock.gif                strScript 
= "var rowNew = tblYXPFL.insertRow();";
InBlock.gif
InBlock.gif                
//污水允许排放量
InBlock.gif
                strScript += "var tdWSYXPFL = rowNew.insertCell();";
InBlock.gif
InBlock.gif                
//设置单元格的ColSpan为4
InBlock.gif
                strScript += "tdWSYXPFL.colSpan = 4;";
InBlock.gif
InBlock.gif                strScript 
+= "tdWSYXPFL.innerHTML = '<center><font color=blue>——————————————</font></center>';";
InBlock.gif
InBlock.gif                
this.win.execScript(strScript, "javascript");
InBlock.gif
InBlock.gif                ((mshtml.HTMLDivElementClass)eleDiv).innerHTML 
= "&nbsp;&nbsp;[排污许可证编号——<font color='red'>无</font>]";
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif
InBlock.gif                ((mshtml.HTMLDivElementClass)eleDiv).innerHTML 
= "&nbsp;&nbsp;[排污许可证编号——<font color='red'>" + dsYXPFL.Tables["允许排放量"].Rows[0]["许可证编号"].ToString() + "</font>]";
InBlock.gif                
InBlock.gif                
if (dsYXPFL.Tables["允许排放量"].Rows.Count > 1)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
/**//*    执行Script为表添加数据行、单元格及单元格格式与数据
InBlock.gif                     *    由于受单元格样式不同的影响,此处只添加表行数-1行数据
InBlock.gif                     *    此循环后的代码添加最后一行数据
InBlock.gif                     *    如果只有一行数据,不执行下面的循环
ExpandedSubBlockEnd.gif                     
*/

InBlock.gif                    
for (int i = 0; i < dsYXPFL.Tables["允许排放量"].Rows.Count - 1; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        strScript 
= "var rowNew = tblYXPFL.insertRow();";
InBlock.gif                        
//污水允许排放量
InBlock.gif
                        strScript += "var tdWSYXPFL = rowNew.insertCell();";
InBlock.gif                        strScript 
+= "tdWSYXPFL.className = 'tdrbborder';";
InBlock.gif                        strScript 
+= "tdWSYXPFL.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[i]["污水允许排放量"].ToString() + "</font>';";
InBlock.gif                        
//污染物
InBlock.gif
                        strScript += "var tdWRW = rowNew.insertCell();";
InBlock.gif                        strScript 
+= "tdWRW.className = 'tdrbborder';";
InBlock.gif                        strScript 
+= "tdWRW.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[i]["污染物"].ToString() + "</font>';";
InBlock.gif                        
//许可浓度
InBlock.gif
                        strScript += "var tdXKND = rowNew.insertCell();";
InBlock.gif                        strScript 
+= "tdXKND.className = 'tdrbborder';";
InBlock.gif                        strScript 
+= "tdXKND.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[i]["许可浓度"].ToString() + "</font>';";
InBlock.gif                        
//许可排放量
InBlock.gif
                        strScript += "var tdXKPFL = rowNew.insertCell();";
InBlock.gif                        strScript 
+= "tdXKPFL.className = 'tdbborder';";
InBlock.gif                        strScript 
+= "tdXKPFL.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[i]["许可排放量"].ToString() + "</font>';";
InBlock.gif
InBlock.gif                        
//执行上面的SCRIPT
InBlock.gif
                        this.win.execScript(strScript, "javascript");
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                strScript 
= "var rowNew = tblYXPFL.insertRow();";
InBlock.gif                
//污水允许排放量
InBlock.gif
                strScript += "var tdWSYXPFL = rowNew.insertCell();";
InBlock.gif                strScript 
+= "tdWSYXPFL.className = 'tdrborder';";
InBlock.gif                strScript 
+= "tdWSYXPFL.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[dsYXPFL.Tables["允许排放量"].Rows.Count - 1]["污水允许排放量"].ToString() + "</font>';";
InBlock.gif                
//污染物
InBlock.gif
                strScript += "var tdWRW = rowNew.insertCell();";
InBlock.gif                strScript 
+= "tdWRW.className = 'tdrborder';";
InBlock.gif                strScript 
+= "tdWRW.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[dsYXPFL.Tables["允许排放量"].Rows.Count - 1]["污染物"].ToString() + "</font>';";
InBlock.gif                
//许可浓度
InBlock.gif
                strScript += "var tdXKND = rowNew.insertCell();";
InBlock.gif                strScript 
+= "tdXKND.className = 'tdrborder';";
InBlock.gif                strScript 
+= "tdXKND.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[dsYXPFL.Tables["允许排放量"].Rows.Count - 1]["许可浓度"].ToString() + "</font>';";
InBlock.gif                
//许可排放量
InBlock.gif
                strScript += "var tdXKPFL = rowNew.insertCell();";
InBlock.gif                strScript 
+= "tdXKPFL.innerHTML = '&nbsp;<font color=blue>" + dsYXPFL.Tables["允许排放量"].Rows[dsYXPFL.Tables["允许排放量"].Rows.Count - 1]["许可排放量"].ToString() + "</font>';";
InBlock.gif
InBlock.gif                
//执行上面的SCRIPT
InBlock.gif
                this.win.execScript(strScript, "javascript");
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            eleDiv 
= null;
InBlock.gif
InBlock.gif            dsYXPFL.Dispose();
InBlock.gif            
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void frm_废水所有信息_Load(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
InBlock.gif            
this.strUnit = "001";
InBlock.gif
InBlock.gif            
this.SetUnitCombo();
InBlock.gif
InBlock.gif            
object url = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"html\html\fsallcondition.htm");
InBlock.gif
InBlock.gif            
object r = System.Reflection.Missing.Value;
InBlock.gif
InBlock.gif            
//装载没有数据的页面
InBlock.gif
            this.awbMain.Navigate2(ref url,ref r,ref r,ref r,ref r);
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif        
private void btnExit_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.Dispose();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif        
private void btnQuery_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif            
/**//*
InBlock.gif             *    每次查询前清空数据,重新加载一遍没有数据的页面即可
InBlock.gif             *    此事件中代码不负责具体的查询数据的工作
ExpandedSubBlockEnd.gif             
*/
    
InBlock.gif            
object url = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"html\html\fsallcondition.htm");
InBlock.gif
InBlock.gif            
object r = System.Reflection.Missing.Value;
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif            
/**//*    装载没有数据的页面
InBlock.gif             *    Navigate2方法会引发awbMain_DocumentComplete事件
InBlock.gif             *    在awbMain_DocumentComplete事件中进行数据的查询
ExpandedSubBlockEnd.gif             
*/

InBlock.gif            
this.awbMain.Navigate2(ref url,ref r,ref r,ref r,ref r);
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 浏览器加载完毕时的处理事件
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="sender"></param>
ExpandedSubBlockEnd.gif        
/// <param name="e"></param>

InBlock.gif        private void awbMain_DocumentComplete(object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (this.intLoadTimes == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
//第一次加载页面时执行该段代码,减少执行次数(只执行一次)
InBlock.gif
                this.doc = (mshtml.IHTMLDocument2)this.awbMain.Document;
InBlock.gif
InBlock.gif                ex 
= (System.Runtime.InteropServices.Expando.IExpando)doc;
InBlock.gif            
InBlock.gif                System.Reflection.PropertyInfo piform 
= ex.AddProperty("MainForm");
InBlock.gif            
InBlock.gif                piform.SetValue(doc, 
thisnull);
InBlock.gif
InBlock.gif                
this.win = this.doc.parentWindow;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockStart.gifContractedSubBlock.gif            
/**//*    在页面中加入了
InBlock.gif             *    <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
InBlock.gif             *    组件后引发了两次awbMain_DocumentComplete事件
InBlock.gif             *    
ExpandedSubBlockEnd.gif             
*/

InBlock.gif            
else if (this.intLoadTimes > 2)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
//不是第一次加载页面时查询数据
InBlock.gif
                string strESBH = this.SetBasicInfo();
InBlock.gif
InBlock.gif                
this.SetExecStandard(strESBH);
InBlock.gif
InBlock.gif                
this.SetYXPFL();
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
this.intLoadTimes ++;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//调用HTML文件中的Javascript进行页面设置
InBlock.gif
        private void btnPS_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.win.execScript("printsetup();""javascript");
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//*    调用HTML文件中的Javascript进行打印预览
InBlock.gif         *    调出打印预览的窗口是不能最大化的,大小取决于本窗体的大小。
InBlock.gif         *    
ExpandedSubBlockEnd.gif         
*/

InBlock.gif        
private void btnPP_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.win.execScript("printpreview();""javascript");
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void button3_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.win.execScript("printit();""javascript");
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif


这个过程中发现的两个问题:
1)在页面中加入了<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>组件后引发了两次awbMain_DocumentComplete事件;

2)调用HTML文件中的Javascript进行打印预览,调出打印预览的窗口是不能最大化的,大小取决于本窗体的大小。

转载于:https://www.cnblogs.com/waxdoll/archive/2005/04/18/139732.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值