zoukankan      html  css  js  c++  java
  • winform在线操作office--dsoframerocx第三方控件

     public Form1()
            {
                InitializeComponent();
                RegControl();//注册控件
                axFramerControl1.Menubar = false;//file栏
                axFramerControl1.Titlebar = false;//标题栏
                // axFramerControl1.Toolbars = false;//工具栏
                axFramerControl1.Dock = DockStyle.Fill;
            }
            private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
            {
    
                //this.axFramerControl1.Open(@"e:2.doc");//注:_filePath为.doc或者.xls为后缀的文件;
                this.axFramerControl1.Open(@"e:1.xls");
    
                axFramerControl1.ModalState = true;
                //axFramerControl1.Activate();
            }
    
            private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                axFramerControl1.Save();
            }
    
           
    
            public bool RegControl()
            {
                try
                {
    
                    string sPath = @"C:DsoFramer" + @"/dsoframer.ocx";
                    ProcessStartInfo psi = new ProcessStartInfo("regsvr32", "/s " + sPath);
                    Process.Start(psi);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                return true;
            }
  • 相关阅读:
    shell习题第21题:计算数字的个数
    shell习题第20题:统计文件大小
    萌新小白
    编程第一天
    萌新报道
    linux下安装php扩展pdo_oci和oci8
    安装Hadoop伪分布式踩过的坑
    zabbix安装过程
    MySQL_索引
    mysql复制
  • 原文地址:https://www.cnblogs.com/junhuang/p/9581316.html
Copyright © 2011-2022 走看看