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 );
            }


        

            
    组件设计器生成的代码

            
    公有方法
        }

    }

  • 相关阅读:
    编程语言的发展趋势及未来方向 目录 编程语言的发展趋势及未来方向 1 第一章 一、历史回顾及趋势概述 2 第一节 首先,编程语言的发展非常缓慢。oo等等,但是远没有好上1000倍。 3 第二节 出现
    Atitit datatype 数据类型 目录 第一章 三大基本类型 数字 字符串 bool 1 第二章 基本类型vs引用类型 1 字符串类型 2 第三章 符合类型vs 简单类型 2 特殊类型
    Atitit 乔姆斯基分类 语言的分类 目录 1.1. 0 –递归可枚举语法 1 1.2. 1 –上下文相关的语法 自然语言 1 1.3. 2 –上下文无关的语法 gpl编程语言 1 1.4. 3
    桁架系统控制
    Pset_RoofCommon
    Pset_ShadingDeviceCommon
    Pset_SlabCommon
    gis数据下载地址
    Pset_StairCommon
    Pset_StairFlightCommon
  • 原文地址:https://www.cnblogs.com/jeet/p/22161.html
Copyright © 2011-2022 走看看