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


        

            
    组件设计器生成的代码

            
    公有方法
        }

    }

  • 相关阅读:
    使用语句修改数据表结构
    C# 写日志到文件
    mysql 语句要求
    跨discuz站获取
    php 记录图片浏览次数次数
    js获取url传递参数值
    jquery.validate.js 验证表单时,在IE当中未验证就直接提交的原因
    mkfs
    mount
    dd
  • 原文地址:https://www.cnblogs.com/jeet/p/22161.html
Copyright © 2020-2023  润新知