• 大小: 4.29MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-07
  • 语言: C/C++
  • 标签: MFC  Excel  

资源简介

可仿Excel的大部分功能,适合操作大量的制式Excel文件。

资源截图

代码片段和文件信息

/*****************************************************************************
 * 
 * ReoGrid - .NET Spreadsheet Control
 * 
 * http://reogrid.net
 *
 * THIS CODE AND INFORMATION IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY
 * KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
 * PURPOSE.
 *
 * ReoGrid and ReoGrid Demo project is released under MIT license.
 *
 * Copyright (c) 2012-2016 Jing 
 * Copyright (c) 2012-2016 unvell.com all rights reserved.
 * 
 ****************************************************************************/

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using System.xml.Serialization;

using unvell.ReoGrid.Editor;

namespace unvell.ReoGrid.Demo
{
public partial class DemoItemsForm : Form
{
public DemoItemsForm()
{
InitializeComponent();

Screen s = Screen.FromControl(this);
int scrWidth = s.WorkingArea.Width;
int scrHeight = s.WorkingArea.Height;
this.Width = (int)(0.7f * scrWidth);
this.Height = (int)(0.9f * scrHeight);
this.Left = (scrWidth - this.Width) / 2;
this.Top = (scrHeight - this.Height) / 2;
}

protected override void onload(EventArgs e)
{
this.Text = “ReoGrid Demo “ + ProductVersion.ToString();

string rootCategory = unvell.ReoGrid.Demo.Properties.Resources.DemoCategory;

using (var sr = new System.IO.StringReader(rootCategory))
{
demoFile = (DemoFile)xmlSerializer.Deserialize(sr) as DemoFile;
}

if (demoFile == null)
{
MessageBox.Show(“Cannot read demo category file correctly. Please redownload the program.“);
Close();
return;
}

tree.BeforeExpand += tree_BeforeExpand;
tree.AfterSelect += tree_AfterSelect;

LoadAllItems();

var dummyGrid = new ReoGridControl();

this.labtitle.Text = dummyGrid.ProductName + “ “ + dummyGrid.ProductVersion.ToString();
web.Visible = false;

// load default demo item
if (!string.IsNullOrEmpty(demoFile.defaultItem))
{
var demoItem = FindDemoItemByName(demoFile demoFile.defaultItem);
if (demoItem != null)
{
this.currentItem = demoItem;
LoadDemo(demoItem);
}
}
}

private DemoFile demoFile;
private xmlSerializer xmlSerializer = new xmlSerializer(typeof(DemoFile));

public void LoadAllItems()
{
LoadCategory(null demoFile);
}

void tree_BeforeExpand(object sender TreeViewCancelEventArgs e)
{
var cat = e.Node.Tag as DemoCategory;
if (cat != null)
{
if (e.Node.Nodes.Count > 0 && e.Node.Nodes[0].Text == “Loading...“)
{
e.Node.Nodes.Clear();
LoadCategory(e.Node cat);
}
}
}

public void LoadCategory(TreeNode node IDemoCategory cc)
{
var parentNode = (node == null ? tree.Nodes : node.Nodes);

foreach (var cat in cc.Categories)
{
var catNode = parentNode.Add(cat.name);
catNode.Tag = cat;
catNode.ImageIndex = 0;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-13 02:12  ReoGrid-master\
     文件        4240  2018-06-13 02:12  ReoGrid-master\.gitignore
     文件        2147  2018-06-13 02:12  ReoGrid-master\Demo.sln
     目录           0  2018-06-13 02:12  ReoGrid-master\Demo\
     目录           0  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\
     文件        2593  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessCellDataDemo.Designer.cs
     文件        1914  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessCellDataDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessCellDataDemo.resx
     文件        2590  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessRangeData.Designer.cs
     文件        1332  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessRangeData.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\AccessRangeData.resx
     文件        2587  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CellTextDemo.Designer.cs
     文件        2065  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CellTextDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CellTextDemo.resx
     文件        2595  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CustomDataFormatDemo.Designer.cs
     文件        1830  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CustomDataFormatDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\CustomDataFormatDemo.resx
     文件        2597  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\IterateCellsAndBorders.Designer.cs
     文件        1182  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\IterateCellsAndBorders.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\IterateCellsAndBorders.resx
     文件        9416  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\MergeCellsDemo.Designer.cs
     文件        2858  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\MergeCellsDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\CellAndRange\MergeCellsDemo.resx
     目录           0  2018-06-13 02:12  ReoGrid-master\Demo\Chart\
     文件        2673  2018-06-13 02:12  ReoGrid-master\Demo\Chart\AreaChartDemo.Designer.cs
     文件        2246  2018-06-13 02:12  ReoGrid-master\Demo\Chart\AreaChartDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\Chart\AreaChartDemo.resx
     文件        3110  2018-06-13 02:12  ReoGrid-master\Demo\Chart\BarChartDemo.Designer.cs
     文件        1962  2018-06-13 02:12  ReoGrid-master\Demo\Chart\BarChartDemo.cs
     文件        5698  2018-06-13 02:12  ReoGrid-master\Demo\Chart\BarChartDemo.resx
     文件        3113  2018-06-13 02:12  ReoGrid-master\Demo\Chart\ColumnChartDemo.Designer.cs
............此处省略1183个文件信息

评论

共有 条评论