zoukankan      html  css  js  c++  java
  • Embed excel into winform

    把Excel嵌入winform中,其实在思路的博客与MSDN都有相关的介绍,但所有的文章对于怎么获得载入的excel对象都没有说得太清楚,下面是我写的一个简单控件,用.net framework 1.1+office 2003测试通过。
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Reflection;
    using System.Windows.Forms;
    using Microsoft.Win32;
    using Microsoft.Office.Interop.Excel;
    using ExcelApplication=Microsoft.Office.Interop.Excel.ApplicationClass;


    namespace ExcelTest
    {
        
    /// <summary>
        
    /// ExcelControl 的摘要说明。
        
    /// </summary>

        public class ExcelControl : System.Windows.Forms.UserControl
        
    {

            
    私有变量、方法和构造函数

            
    /// <summary> 
            
    /// 清理所有正在使用的资源。
            
    /// </summary>

            protected override void Dispose( bool disposing )
            
    {
                
    if( disposing )
                
    {
                    
    if(components != null)
                    
    {
                        releaseExcel();
                        components.Dispose();
                    }

                }

                
    base.Dispose( disposing );
            }


        

            
    组件设计器生成的代码

            
    公有方法
        }

    }

  • 相关阅读:
    java图片裁剪原理
    代码整洁之道
    vue.js devtools安装
    Convert DateTime To Varchar with multiple Styles
    Sql Server为数值变量添加删除前导后缀(翻译)
    asp.net ckeditor 3.6.2 + ckfinder 2.1 上传图片
    转摘 IE6 动态创建 iframe 无法显示的 bug
    sql server output parameter
    windows7 无法删除文件夹 提示需要SYSTEM权限
    Kooboo 全文索引研究
  • 原文地址:https://www.cnblogs.com/jeet/p/22161.html
Copyright © 2011-2022 走看看