Recalculation of linked files (C# / netframework)
Note
This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\77.Recalculation Of Linked Files and also at https://github.com/tmssoftware/TMS-FlexCel.NET-demos/tree/master/csharp/VS2022/netframework/Modules/10.API/77.Recalculation Of Linked Files
Overview
FlexCel allows complete control over recalculation of linked files. In this demo, we will show how to create 3 linked files and how to recalculate them.
Concepts
How to create files with formulas that link to other files.
There are two ways to create a workspace to calculate linked files:
When you know all the files needed in advance, you just add them to the workspace before recalculating.
If you don't know which files (if any) you are going to need, you can use an event to load them on demand. This is the approach we use in the Validate Recalc example, since it deals with arbitrary files. Whenever you know which files are needed, it is better to use the first method.
Workspaces can take a lot of memory. Make sure you make them null after recalculating, and also the XlsFiles used in it. If you keep the files, those files will point to the workspace even if you make it null, and it will not be released. You can also Clear() the workspace before making it null to make sure you leave no references to it.
Files
AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("7.21.0.0")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Form1.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Globalization;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
namespace RecalculationOfLinkedFiles
{
/// <summary>
/// Shows how to recalculate linked files.
/// </summary>
public partial class mainForm: System.Windows.Forms.Form
{
public mainForm()
{
InitializeComponent();
}
private void button2_Click(object sender, System.EventArgs e)
{
Close();
}
private void CellA1_TextChanged(object sender, System.EventArgs e)
{
//This is a very slow way to do this (recreating the full 3 files each time you type a character)
//but it is the best for what we want to show. (how to create and recalculate spreadsheets)
//In a real world example you would keep the created files in memory and just recalculate them
//when there is a change.
CreateFilesAndRecalculate();
}
/// <summary>
/// This method will try to convert a text to a string, and if not possible, return the text.
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
private object GetValue(string s)
{
double d;
if (Double.TryParse(s, NumberStyles.Any, CultureInfo.CurrentCulture, out d)) return d;
return s;
}
private void CreateFilesAndRecalculate()
{
//Set up the files.
XlsFile xls1 = new XlsFile();
xls1.NewFile(1, TExcelFileFormat.v2019);
xls1.SetCellValue(1, 1, GetValue(CellA1.Text));
xls1.SetCellValue(2, 1, new TFormula("=[Third File.xls]Sheet1!A1 + 7"));
XlsFile xls2 = new XlsFile();
xls2.NewFile(1, TExcelFileFormat.v2019);
xls2.SetCellValue(1, 1, new TFormula("=[First File.xls]Sheet1!A1 * 2"));
XlsFile xls3 = new XlsFile();
xls3.NewFile(1, TExcelFileFormat.v2019);
xls3.SetCellValue(1, 1, new TFormula("=[Second File.xls]Sheet1!A1 * 5"));
//Create a workspace to recalculate them.
//In this case, as we know what files we need in advance, we will just add them to the workspace
//For an example on how to load files on demand, take a look at the chart example in this demo.
TWorkspace Workspace = new TWorkspace();
Workspace.Add("First File.xls", xls1);
Workspace.Add("Second File.xls", xls2);
Workspace.Add("Third File.xls", xls3);
//Now that the workspace is set, we can recalculate. We could recalc() in the Workspace object or in any of the files in it.
//The effect is the same, all files will be recalculated.
//DO NOT RECALCULATE EVERY FILE. EACH TIME YOU CALCULATE ONE, YOU ARE CALCULATING THEM ALL.
xls1.Recalc();
//Ok, now it is time to show the results.
Cell2.Text = Convert.ToString(((TFormula)xls2.GetCellValue(1, 1)).Result);
Cell3.Text = Convert.ToString(((TFormula)xls3.GetCellValue(1, 1)).Result);
Cell4.Text = Convert.ToString(((TFormula)xls1.GetCellValue(2, 1)).Result);
//In this example both the workspace and the xls files are local objects, so we don't need to worry about memory
//If any of them is a global object, remember that keeping a reference to it will keep a reference to *ALL* the
//files in the workspace (even if you make Workspace = null). You might want to call Workspace.Clear() in that case before setting it to null.
}
private void Chart_TextChanged(object sender, System.EventArgs e)
{
//Again, loading the file each time we press a key is incredibly silly. But for this example is ok,
//since loading the files is what we actually want to show.
string TemplatePath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..");
XlsFile xlsChart = new XlsFile();
xlsChart.Open(Path.Combine(TemplatePath, "Chart.xls"));
//Create a Workspace.
//Note that if we didn't create this workspace, the chart would not show, since it wouldn't be able to
//find the linked file. You can verify it by commenting the following lines
TWorkspace Workspace = new TWorkspace();
Workspace.Add("Chart.xls", xlsChart); //We always need to have the main file in the workspace.
//The best thing here would be to also add "ChartData.xls" to the workspace, since we already know which file we need.
//But since we already saw how to do that in the other example in this demo, we are going to pretend we don't know which files
//we need, and load them on demand.
//NOTE: DON'T LOAD FILES ON DEMAND UNLESS YOU REALLY NEED TO, SINCE YOU MIGHT BE CREATING A SECURITY RISK. Read the API GUIDE PDF for more information.
Workspace.LoadLinkedFile += new LoadLinkedFileEventHandler(Workspace_LoadLinkedFile);
//Now that the Workspace is created, we can render the chart. We will use the code from "Render Objects" demo.
if (chartBox.Image != null) chartBox.Image.Dispose();
chartBox.Image = GetChart(xlsChart, 1); //To do this well, we should name the chart, retrieve the object index and use it here.
//To see how this should be done, look at the Render Objects demo. Here we won't care about that, and just use "1" since we know the chart is the only object in the file.
}
/// <summary>
/// This event is used when there are linked files, to load them on demand.
/// </summary>
private void Workspace_LoadLinkedFile(object sender, LoadLinkedFileEventArgs e)
{
//In order to reduce the risk of opening any file, in this demo we are going to only open files in the same folder we are working on.
XlsFile xls = new XlsFile();
string TemplatePath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..");
xls.Open(Path.Combine(TemplatePath, Path.GetFileName(e.FileName)));
e.Xls = xls;
//A normal event should end here. Since we need to change the values of the file we loaded in demand, we will do that here.
xls.SetCellValue(4, 2, GetValue(ChartA1.Text));
xls.SetCellValue(5, 2, GetValue(ChartA2.Text));
xls.SetCellValue(6, 2, GetValue(ChartA3.Text));
xls.SetCellValue(4, 3, GetValue(ChartB1.Text));
xls.SetCellValue(5, 3, GetValue(ChartB2.Text));
xls.SetCellValue(6, 3, GetValue(ChartB3.Text));
}
//This code is from the "Render objects" demo, and returns the image of a chart.
private Image GetChart(ExcelFile Xls, int ChartIndex)
{
TShapeProperties ChartProps = Xls.GetObjectProperties(ChartIndex, true);
//We could get the chart with the following command,
//but it would be fixed size. In this example we are going to be a little more complex.
//Xls.RenderObject(ChartIndex);
//A more complex way to retrieve the chart, to show how to use
//all parameters in renderobject.
TUIRectangle ImageDimensions;
TPointF Origin;
TUISize SizePixels;
//First calculate the chart dimensions without actually rendering it. This is fast.
Xls.RenderObject(ChartIndex, 96, ChartProps,
SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, false,
out Origin, out ImageDimensions, out SizePixels);
float dpi = 96; //default screen resolution
if (SizePixels.Height > 0 && SizePixels.Width > 0)
{
double AspectX = (double)chartBox.Width / SizePixels.Width;
double AspectY = (double)chartBox.Height / SizePixels.Height;
double Aspect = Math.Max(AspectX, AspectY);
//Make the dpi adjust the screen resolution and the size of the form.
dpi = (float)(96 * Aspect);
if (dpi < 20) dpi = 20;
if (dpi > 500) dpi = 500;
}
return Xls.RenderObject(ChartIndex, dpi, ChartProps,
SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, true,
out Origin, out ImageDimensions, out SizePixels);
}
}
}
Form1.Designer.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Globalization;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
namespace RecalculationOfLinkedFiles
{
public partial class mainForm: System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox CellA1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox Cell2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox Cell3;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox Cell4;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.TextBox ChartA1;
private System.Windows.Forms.TextBox ChartB1;
private System.Windows.Forms.TextBox ChartB2;
private System.Windows.Forms.TextBox ChartA2;
private System.Windows.Forms.TextBox ChartB3;
private System.Windows.Forms.TextBox ChartA3;
private System.Windows.Forms.PictureBox chartBox;
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
this.panel2 = new System.Windows.Forms.Panel();
this.button2 = new System.Windows.Forms.Button();
this.CellA1 = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.Cell4 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.Cell3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.Cell2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.ChartA1 = new System.Windows.Forms.TextBox();
this.panel3 = new System.Windows.Forms.Panel();
this.chartBox = new System.Windows.Forms.PictureBox();
this.ChartB3 = new System.Windows.Forms.TextBox();
this.ChartA3 = new System.Windows.Forms.TextBox();
this.ChartB2 = new System.Windows.Forms.TextBox();
this.ChartA2 = new System.Windows.Forms.TextBox();
this.ChartB1 = new System.Windows.Forms.TextBox();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chartBox)).BeginInit();
this.SuspendLayout();
//
// panel2
//
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel2.Controls.Add(this.button2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.Location = new System.Drawing.Point(0, 422);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(760, 32);
this.panel2.TabIndex = 2;
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button2.BackColor = System.Drawing.SystemColors.Control;
this.button2.Image = ((System.Drawing.Image)(resources.GetObject("button2.Image")));
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button2.Location = new System.Drawing.Point(697, 2);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(56, 26);
this.button2.TabIndex = 2;
this.button2.Text = "Exit";
this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// CellA1
//
this.CellA1.Location = new System.Drawing.Point(24, 88);
this.CellA1.Name = "CellA1";
this.CellA1.Size = new System.Drawing.Size(100, 20);
this.CellA1.TabIndex = 3;
this.CellA1.TextChanged += new System.EventHandler(this.CellA1_TextChanged);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.label9);
this.panel1.Controls.Add(this.Cell4);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.Cell3);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.Cell2);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.CellA1);
this.panel1.Location = new System.Drawing.Point(8, 8);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(736, 136);
this.panel1.TabIndex = 4;
//
// label8
//
this.label8.Location = new System.Drawing.Point(520, 72);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(160, 16);
this.label8.TabIndex = 15;
this.label8.Text = "=[Third File.xls]Sheet1!A1 + 7";
//
// label9
//
this.label9.Location = new System.Drawing.Point(520, 56);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(100, 16);
this.label9.TabIndex = 14;
this.label9.Text = "First File: A2";
//
// Cell4
//
this.Cell4.Enabled = false;
this.Cell4.Location = new System.Drawing.Point(520, 88);
this.Cell4.Name = "Cell4";
this.Cell4.Size = new System.Drawing.Size(152, 20);
this.Cell4.TabIndex = 13;
//
// label6
//
this.label6.Location = new System.Drawing.Point(328, 72);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(184, 16);
this.label6.TabIndex = 12;
this.label6.Text = "=[Second File.xls]Sheet1!A1 * 5";
//
// label7
//
this.label7.Location = new System.Drawing.Point(328, 56);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(100, 16);
this.label7.TabIndex = 11;
this.label7.Text = "Third File: A1";
//
// Cell3
//
this.Cell3.Enabled = false;
this.Cell3.Location = new System.Drawing.Point(328, 88);
this.Cell3.Name = "Cell3";
this.Cell3.Size = new System.Drawing.Size(152, 20);
this.Cell3.TabIndex = 10;
//
// label5
//
this.label5.Location = new System.Drawing.Point(152, 72);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(152, 16);
this.label5.TabIndex = 9;
this.label5.Text = "=[First File.xls]Sheet1!A1 * 2";
//
// label4
//
this.label4.Location = new System.Drawing.Point(24, 72);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(100, 16);
this.label4.TabIndex = 8;
this.label4.Text = "Constant";
//
// label3
//
this.label3.Location = new System.Drawing.Point(152, 56);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(100, 16);
this.label3.TabIndex = 7;
this.label3.Text = "Second File: A1";
//
// Cell2
//
this.Cell2.Enabled = false;
this.Cell2.Location = new System.Drawing.Point(152, 88);
this.Cell2.Name = "Cell2";
this.Cell2.Size = new System.Drawing.Size(144, 20);
this.Cell2.TabIndex = 6;
//
// label2
//
this.label2.Location = new System.Drawing.Point(24, 56);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(100, 16);
this.label2.TabIndex = 5;
this.label2.Text = "First File: A1";
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(16, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(704, 32);
this.label1.TabIndex = 4;
this.label1.Text = "In this first example we will dynamically create 3 linked files. We will create a" +
" workspace to link the files, and see how recalculation works.";
//
// label18
//
this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label18.Location = new System.Drawing.Point(16, 16);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(704, 32);
this.label18.TabIndex = 4;
this.label18.Text = "This second example shows how to load files when we don\'t know a priori which fil" +
"es we need to recalculate a file. To make it more interesting, we will use a cha" +
"rt linked to other file.";
//
// ChartA1
//
this.ChartA1.Location = new System.Drawing.Point(16, 56);
this.ChartA1.Name = "ChartA1";
this.ChartA1.Size = new System.Drawing.Size(64, 20);
this.ChartA1.TabIndex = 3;
this.ChartA1.Text = "1";
this.ChartA1.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// panel3
//
this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel3.Controls.Add(this.chartBox);
this.panel3.Controls.Add(this.ChartB3);
this.panel3.Controls.Add(this.ChartA3);
this.panel3.Controls.Add(this.ChartB2);
this.panel3.Controls.Add(this.ChartA2);
this.panel3.Controls.Add(this.ChartB1);
this.panel3.Controls.Add(this.label18);
this.panel3.Controls.Add(this.ChartA1);
this.panel3.Location = new System.Drawing.Point(8, 176);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(736, 225);
this.panel3.TabIndex = 5;
//
// chartBox
//
this.chartBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.chartBox.Location = new System.Drawing.Point(176, 56);
this.chartBox.Name = "chartBox";
this.chartBox.Size = new System.Drawing.Size(544, 152);
this.chartBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.chartBox.TabIndex = 52;
this.chartBox.TabStop = false;
//
// ChartB3
//
this.ChartB3.Location = new System.Drawing.Point(88, 104);
this.ChartB3.Name = "ChartB3";
this.ChartB3.Size = new System.Drawing.Size(64, 20);
this.ChartB3.TabIndex = 9;
this.ChartB3.Text = "5";
this.ChartB3.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// ChartA3
//
this.ChartA3.Location = new System.Drawing.Point(16, 104);
this.ChartA3.Name = "ChartA3";
this.ChartA3.Size = new System.Drawing.Size(64, 20);
this.ChartA3.TabIndex = 8;
this.ChartA3.Text = "3";
this.ChartA3.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// ChartB2
//
this.ChartB2.Location = new System.Drawing.Point(88, 80);
this.ChartB2.Name = "ChartB2";
this.ChartB2.Size = new System.Drawing.Size(64, 20);
this.ChartB2.TabIndex = 7;
this.ChartB2.Text = "4";
this.ChartB2.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// ChartA2
//
this.ChartA2.Location = new System.Drawing.Point(16, 80);
this.ChartA2.Name = "ChartA2";
this.ChartA2.Size = new System.Drawing.Size(64, 20);
this.ChartA2.TabIndex = 6;
this.ChartA2.Text = "2";
this.ChartA2.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// ChartB1
//
this.ChartB1.Location = new System.Drawing.Point(88, 56);
this.ChartB1.Name = "ChartB1";
this.ChartB1.Size = new System.Drawing.Size(64, 20);
this.ChartB1.TabIndex = 5;
this.ChartB1.Text = "3";
this.ChartB1.TextChanged += new System.EventHandler(this.Chart_TextChanged);
//
// mainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(760, 454);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Name = "mainForm";
this.Text = "Calculation of linked files";
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.chartBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
}
}
Program.cs
using System;
using System.Windows.Forms;
namespace RecalculationOfLinkedFiles
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new mainForm());
}
}
}