inti MDI
This commit is contained in:
parent
5385f9ffad
commit
b7cdc094f2
@ -58,6 +58,12 @@
|
|||||||
<Compile Include="frmSummary.Designer.cs">
|
<Compile Include="frmSummary.Designer.cs">
|
||||||
<DependentUpon>frmSummary.cs</DependentUpon>
|
<DependentUpon>frmSummary.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="frmMain.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmMain.Designer.cs">
|
||||||
|
<DependentUpon>frmMain.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Program.cs"/>
|
<Compile Include="Program.cs"/>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs"/>
|
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||||
<EmbeddedResource Include="frmCalculate.resx">
|
<EmbeddedResource Include="frmCalculate.resx">
|
||||||
@ -66,6 +72,9 @@
|
|||||||
<EmbeddedResource Include="frmSummary.resx">
|
<EmbeddedResource Include="frmSummary.resx">
|
||||||
<DependentUpon>frmSummary.cs</DependentUpon>
|
<DependentUpon>frmSummary.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="frmMain.resx">
|
||||||
|
<DependentUpon>frmMain.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
@ -16,7 +16,7 @@ namespace Chapter6
|
|||||||
{
|
{
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new frmCalculate());
|
Application.Run(new frmMain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
201
Chapter6/frmMain.Designer.cs
generated
Normal file
201
Chapter6/frmMain.Designer.cs
generated
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
partial class frmMain
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (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()
|
||||||
|
{
|
||||||
|
this.Menu = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuFileExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEdit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditCalculate = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditSummary = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditShowStudents = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditAddStudents = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditSearchStudent = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuWindow = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuWindowArrangeIcons = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuWindowsCascade = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.munWindowHorizontal = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuWindowVertical = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuWindowCloseAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuHelpAbout = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.Menu.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// Menu
|
||||||
|
//
|
||||||
|
this.Menu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuFile, this.mnuEdit, this.mnuWindow, this.mnuHelp });
|
||||||
|
this.Menu.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.Menu.Name = "Menu";
|
||||||
|
this.Menu.Size = new System.Drawing.Size(800, 24);
|
||||||
|
this.Menu.TabIndex = 1;
|
||||||
|
this.Menu.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// mnuFile
|
||||||
|
//
|
||||||
|
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuFileExit });
|
||||||
|
this.mnuFile.Name = "mnuFile";
|
||||||
|
this.mnuFile.Size = new System.Drawing.Size(37, 20);
|
||||||
|
this.mnuFile.Text = "File";
|
||||||
|
//
|
||||||
|
// mnuFileExit
|
||||||
|
//
|
||||||
|
this.mnuFileExit.Name = "mnuFileExit";
|
||||||
|
this.mnuFileExit.Size = new System.Drawing.Size(152, 22);
|
||||||
|
this.mnuFileExit.Text = "Exit";
|
||||||
|
this.mnuFileExit.Click += new System.EventHandler(this.mnuFileExit_Click_1);
|
||||||
|
//
|
||||||
|
// mnuEdit
|
||||||
|
//
|
||||||
|
this.mnuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuEditCalculate, this.mnuEditSummary, this.mnuEditShowStudents, this.mnuEditAddStudents, this.mnuEditSearchStudent });
|
||||||
|
this.mnuEdit.Name = "mnuEdit";
|
||||||
|
this.mnuEdit.Size = new System.Drawing.Size(39, 20);
|
||||||
|
this.mnuEdit.Text = "Edit";
|
||||||
|
//
|
||||||
|
// mnuEditCalculate
|
||||||
|
//
|
||||||
|
this.mnuEditCalculate.Name = "mnuEditCalculate";
|
||||||
|
this.mnuEditCalculate.Size = new System.Drawing.Size(153, 22);
|
||||||
|
this.mnuEditCalculate.Text = "Calculate";
|
||||||
|
//
|
||||||
|
// mnuEditSummary
|
||||||
|
//
|
||||||
|
this.mnuEditSummary.Name = "mnuEditSummary";
|
||||||
|
this.mnuEditSummary.Size = new System.Drawing.Size(153, 22);
|
||||||
|
this.mnuEditSummary.Text = "Summary";
|
||||||
|
//
|
||||||
|
// mnuEditShowStudents
|
||||||
|
//
|
||||||
|
this.mnuEditShowStudents.Name = "mnuEditShowStudents";
|
||||||
|
this.mnuEditShowStudents.Size = new System.Drawing.Size(153, 22);
|
||||||
|
this.mnuEditShowStudents.Text = "Show Students";
|
||||||
|
//
|
||||||
|
// mnuEditAddStudents
|
||||||
|
//
|
||||||
|
this.mnuEditAddStudents.Name = "mnuEditAddStudents";
|
||||||
|
this.mnuEditAddStudents.Size = new System.Drawing.Size(153, 22);
|
||||||
|
this.mnuEditAddStudents.Text = "Add Students";
|
||||||
|
//
|
||||||
|
// mnuEditSearchStudent
|
||||||
|
//
|
||||||
|
this.mnuEditSearchStudent.Name = "mnuEditSearchStudent";
|
||||||
|
this.mnuEditSearchStudent.Size = new System.Drawing.Size(153, 22);
|
||||||
|
this.mnuEditSearchStudent.Text = "Search Student";
|
||||||
|
//
|
||||||
|
// mnuWindow
|
||||||
|
//
|
||||||
|
this.mnuWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuWindowArrangeIcons, this.mnuWindowsCascade, this.munWindowHorizontal, this.mnuWindowVertical, this.mnuWindowCloseAll });
|
||||||
|
this.mnuWindow.Name = "mnuWindow";
|
||||||
|
this.mnuWindow.Size = new System.Drawing.Size(63, 20);
|
||||||
|
this.mnuWindow.Text = "Window";
|
||||||
|
//
|
||||||
|
// mnuWindowArrangeIcons
|
||||||
|
//
|
||||||
|
this.mnuWindowArrangeIcons.Name = "mnuWindowArrangeIcons";
|
||||||
|
this.mnuWindowArrangeIcons.Size = new System.Drawing.Size(147, 22);
|
||||||
|
this.mnuWindowArrangeIcons.Text = "Arrange Icons";
|
||||||
|
//
|
||||||
|
// mnuWindowsCascade
|
||||||
|
//
|
||||||
|
this.mnuWindowsCascade.Name = "mnuWindowsCascade";
|
||||||
|
this.mnuWindowsCascade.Size = new System.Drawing.Size(147, 22);
|
||||||
|
this.mnuWindowsCascade.Text = "Cascade";
|
||||||
|
//
|
||||||
|
// munWindowHorizontal
|
||||||
|
//
|
||||||
|
this.munWindowHorizontal.Name = "munWindowHorizontal";
|
||||||
|
this.munWindowHorizontal.Size = new System.Drawing.Size(147, 22);
|
||||||
|
this.munWindowHorizontal.Text = "Horizontal";
|
||||||
|
//
|
||||||
|
// mnuWindowVertical
|
||||||
|
//
|
||||||
|
this.mnuWindowVertical.Name = "mnuWindowVertical";
|
||||||
|
this.mnuWindowVertical.Size = new System.Drawing.Size(147, 22);
|
||||||
|
this.mnuWindowVertical.Text = "Vertical";
|
||||||
|
//
|
||||||
|
// mnuWindowCloseAll
|
||||||
|
//
|
||||||
|
this.mnuWindowCloseAll.Name = "mnuWindowCloseAll";
|
||||||
|
this.mnuWindowCloseAll.Size = new System.Drawing.Size(147, 22);
|
||||||
|
this.mnuWindowCloseAll.Text = "Close All";
|
||||||
|
//
|
||||||
|
// mnuHelp
|
||||||
|
//
|
||||||
|
this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuHelpAbout });
|
||||||
|
this.mnuHelp.Name = "mnuHelp";
|
||||||
|
this.mnuHelp.Size = new System.Drawing.Size(44, 20);
|
||||||
|
this.mnuHelp.Text = "Help";
|
||||||
|
//
|
||||||
|
// mnuHelpAbout
|
||||||
|
//
|
||||||
|
this.mnuHelpAbout.Name = "mnuHelpAbout";
|
||||||
|
this.mnuHelpAbout.Size = new System.Drawing.Size(107, 22);
|
||||||
|
this.mnuHelpAbout.Text = "About";
|
||||||
|
//
|
||||||
|
// frmMain
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.Menu);
|
||||||
|
this.IsMdiContainer = true;
|
||||||
|
this.MainMenuStrip = this.Menu;
|
||||||
|
this.Name = "frmMain";
|
||||||
|
this.Text = "MDI";
|
||||||
|
this.Menu.ResumeLayout(false);
|
||||||
|
this.Menu.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditCalculate;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditSummary;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditShowStudents;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditAddStudents;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditSearchStudent;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuWindow;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuWindowArrangeIcons;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuWindowsCascade;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem munWindowHorizontal;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuWindowVertical;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuWindowCloseAll;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuHelp;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuHelpAbout;
|
||||||
|
|
||||||
|
private System.Windows.Forms.MenuStrip Menu;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuFile;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuFileExit;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEdit;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
23
Chapter6/frmMain.cs
Normal file
23
Chapter6/frmMain.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
public partial class frmMain : Form
|
||||||
|
{
|
||||||
|
public frmMain()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mnuFileExit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mnuFileExit_Click_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
123
Chapter6/frmMain.resx
Normal file
123
Chapter6/frmMain.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="Menu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
6
MDI/App.config
Normal file
6
MDI/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
92
MDI/Chapter6.csproj
Normal file
92
MDI/Chapter6.csproj
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{A7E2FD06-A779-43A4-B838-262A2A840A63}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>Chapter6</RootNamespace>
|
||||||
|
<AssemblyName>Chapter6</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System"/>
|
||||||
|
<Reference Include="System.Core"/>
|
||||||
|
<Reference Include="System.Xml.Linq"/>
|
||||||
|
<Reference Include="System.Data.DataSetExtensions"/>
|
||||||
|
<Reference Include="Microsoft.CSharp"/>
|
||||||
|
<Reference Include="System.Data"/>
|
||||||
|
<Reference Include="System.Deployment"/>
|
||||||
|
<Reference Include="System.Drawing"/>
|
||||||
|
<Reference Include="System.Net.Http"/>
|
||||||
|
<Reference Include="System.Windows.Forms"/>
|
||||||
|
<Reference Include="System.Xml"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="frmCalculate.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmCalculate.Designer.cs">
|
||||||
|
<DependentUpon>frmCalculate.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmSummary.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmSummary.Designer.cs">
|
||||||
|
<DependentUpon>frmSummary.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs"/>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||||
|
<EmbeddedResource Include="frmCalculate.resx">
|
||||||
|
<DependentUpon>frmCalculate.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="frmSummary.resx">
|
||||||
|
<DependentUpon>frmSummary.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||||
|
</Project>
|
22
MDI/Program.cs
Normal file
22
MDI/Program.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new frmCalculate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
MDI/Properties/AssemblyInfo.cs
Normal file
36
MDI/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 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("Chapter6")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Chapter6")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("A7E2FD06-A779-43A4-B838-262A2A840A63")]
|
||||||
|
|
||||||
|
// 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 Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
69
MDI/Properties/Resources.Designer.cs
generated
Normal file
69
MDI/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Chapter6.Properties
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder",
|
||||||
|
"4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance",
|
||||||
|
"CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState
|
||||||
|
.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp =
|
||||||
|
new global::System.Resources.ResourceManager("Chapter6.Properties.Resources",
|
||||||
|
typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState
|
||||||
|
.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get { return resourceCulture; }
|
||||||
|
set { resourceCulture = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
117
MDI/Properties/Resources.resx
Normal file
117
MDI/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
26
MDI/Properties/Settings.Designer.cs
generated
Normal file
26
MDI/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Chapter6.Properties
|
||||||
|
{
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(
|
||||||
|
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
private static Settings defaultInstance =
|
||||||
|
((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get { return defaultInstance; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
MDI/Properties/Settings.settings
Normal file
7
MDI/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
247
MDI/frmCalculate.Designer.cs
generated
Normal file
247
MDI/frmCalculate.Designer.cs
generated
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
partial class frmCalculate
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (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()
|
||||||
|
{
|
||||||
|
this.btnCalc = new System.Windows.Forms.Button();
|
||||||
|
this.lblOut = new System.Windows.Forms.Label();
|
||||||
|
this.txtDiscount = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtPrice = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.lblDisQuantity = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisPrice = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisDiscount = new System.Windows.Forms.Label();
|
||||||
|
this.miniToolStrip = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuMain = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuFileExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEdit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditCalculate = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuEditSSummary = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.windowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.miniToolStrip.SuspendLayout();
|
||||||
|
this.mnuMain.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// btnCalc
|
||||||
|
//
|
||||||
|
this.btnCalc.Location = new System.Drawing.Point(235, 189);
|
||||||
|
this.btnCalc.Name = "btnCalc";
|
||||||
|
this.btnCalc.Size = new System.Drawing.Size(125, 34);
|
||||||
|
this.btnCalc.TabIndex = 0;
|
||||||
|
this.btnCalc.Text = "Calculate";
|
||||||
|
this.btnCalc.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCalc.Click += new System.EventHandler(this.btnCalc_Click);
|
||||||
|
//
|
||||||
|
// lblOut
|
||||||
|
//
|
||||||
|
this.lblOut.BackColor = System.Drawing.SystemColors.Info;
|
||||||
|
this.lblOut.Location = new System.Drawing.Point(234, 154);
|
||||||
|
this.lblOut.Name = "lblOut";
|
||||||
|
this.lblOut.Size = new System.Drawing.Size(125, 25);
|
||||||
|
this.lblOut.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// txtDiscount
|
||||||
|
//
|
||||||
|
this.txtDiscount.Location = new System.Drawing.Point(235, 110);
|
||||||
|
this.txtDiscount.Name = "txtDiscount";
|
||||||
|
this.txtDiscount.Size = new System.Drawing.Size(125, 20);
|
||||||
|
this.txtDiscount.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// txtPrice
|
||||||
|
//
|
||||||
|
this.txtPrice.Location = new System.Drawing.Point(234, 84);
|
||||||
|
this.txtPrice.Name = "txtPrice";
|
||||||
|
this.txtPrice.Size = new System.Drawing.Size(125, 20);
|
||||||
|
this.txtPrice.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// txtQuantity
|
||||||
|
//
|
||||||
|
this.txtQuantity.Location = new System.Drawing.Point(235, 58);
|
||||||
|
this.txtQuantity.Name = "txtQuantity";
|
||||||
|
this.txtQuantity.Size = new System.Drawing.Size(125, 20);
|
||||||
|
this.txtQuantity.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// lblDisQuantity
|
||||||
|
//
|
||||||
|
this.lblDisQuantity.Location = new System.Drawing.Point(81, 61);
|
||||||
|
this.lblDisQuantity.Name = "lblDisQuantity";
|
||||||
|
this.lblDisQuantity.Size = new System.Drawing.Size(148, 19);
|
||||||
|
this.lblDisQuantity.TabIndex = 5;
|
||||||
|
this.lblDisQuantity.Text = "Quantity:";
|
||||||
|
this.lblDisQuantity.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// lblDisPrice
|
||||||
|
//
|
||||||
|
this.lblDisPrice.Location = new System.Drawing.Point(81, 84);
|
||||||
|
this.lblDisPrice.Name = "lblDisPrice";
|
||||||
|
this.lblDisPrice.Size = new System.Drawing.Size(148, 19);
|
||||||
|
this.lblDisPrice.TabIndex = 6;
|
||||||
|
this.lblDisPrice.Text = "Price:";
|
||||||
|
this.lblDisPrice.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// lblDisDiscount
|
||||||
|
//
|
||||||
|
this.lblDisDiscount.Location = new System.Drawing.Point(81, 110);
|
||||||
|
this.lblDisDiscount.Name = "lblDisDiscount";
|
||||||
|
this.lblDisDiscount.Size = new System.Drawing.Size(148, 19);
|
||||||
|
this.lblDisDiscount.TabIndex = 7;
|
||||||
|
this.lblDisDiscount.Text = "Discount (%):";
|
||||||
|
this.lblDisDiscount.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// miniToolStrip
|
||||||
|
//
|
||||||
|
this.miniToolStrip.AutoSize = false;
|
||||||
|
this.miniToolStrip.Dock = System.Windows.Forms.DockStyle.None;
|
||||||
|
this.miniToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem1 });
|
||||||
|
this.miniToolStrip.Location = new System.Drawing.Point(131, 2);
|
||||||
|
this.miniToolStrip.Name = "miniToolStrip";
|
||||||
|
this.miniToolStrip.Size = new System.Drawing.Size(800, 24);
|
||||||
|
this.miniToolStrip.TabIndex = 8;
|
||||||
|
this.miniToolStrip.Visible = false;
|
||||||
|
//
|
||||||
|
// toolStripMenuItem1
|
||||||
|
//
|
||||||
|
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||||
|
this.toolStripMenuItem1.Size = new System.Drawing.Size(125, 20);
|
||||||
|
this.toolStripMenuItem1.Text = "toolStripMenuItem1";
|
||||||
|
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
|
||||||
|
//
|
||||||
|
// mnuMain
|
||||||
|
//
|
||||||
|
this.mnuMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.mnuEdit, this.windowToolStripMenuItem, this.helpToolStripMenuItem });
|
||||||
|
this.mnuMain.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.mnuMain.Name = "mnuMain";
|
||||||
|
this.mnuMain.Size = new System.Drawing.Size(800, 24);
|
||||||
|
this.mnuMain.TabIndex = 9;
|
||||||
|
this.mnuMain.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// fileToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuFileExit });
|
||||||
|
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||||
|
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||||
|
this.fileToolStripMenuItem.Text = "File";
|
||||||
|
//
|
||||||
|
// mnuFileExit
|
||||||
|
//
|
||||||
|
this.mnuFileExit.Name = "mnuFileExit";
|
||||||
|
this.mnuFileExit.Size = new System.Drawing.Size(93, 22);
|
||||||
|
this.mnuFileExit.Text = "Exit";
|
||||||
|
//
|
||||||
|
// mnuEdit
|
||||||
|
//
|
||||||
|
this.mnuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuEditCalculate, this.mnuEditSSummary });
|
||||||
|
this.mnuEdit.Name = "mnuEdit";
|
||||||
|
this.mnuEdit.Size = new System.Drawing.Size(39, 20);
|
||||||
|
this.mnuEdit.Text = "Edit";
|
||||||
|
//
|
||||||
|
// mnuEditCalculate
|
||||||
|
//
|
||||||
|
this.mnuEditCalculate.Name = "mnuEditCalculate";
|
||||||
|
this.mnuEditCalculate.Size = new System.Drawing.Size(157, 22);
|
||||||
|
this.mnuEditCalculate.Text = "Calculate";
|
||||||
|
this.mnuEditCalculate.Click += new System.EventHandler(this.mnuEditCalculate_Click);
|
||||||
|
//
|
||||||
|
// mnuEditSSummary
|
||||||
|
//
|
||||||
|
this.mnuEditSSummary.Name = "mnuEditSSummary";
|
||||||
|
this.mnuEditSSummary.Size = new System.Drawing.Size(157, 22);
|
||||||
|
this.mnuEditSSummary.Text = "Show Summary";
|
||||||
|
this.mnuEditSSummary.Click += new System.EventHandler(this.mnuEditSSummary_Click);
|
||||||
|
//
|
||||||
|
// windowToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.windowToolStripMenuItem.Name = "windowToolStripMenuItem";
|
||||||
|
this.windowToolStripMenuItem.Size = new System.Drawing.Size(63, 20);
|
||||||
|
this.windowToolStripMenuItem.Text = "Window";
|
||||||
|
//
|
||||||
|
// helpToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
|
||||||
|
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||||
|
this.helpToolStripMenuItem.Text = "Help";
|
||||||
|
//
|
||||||
|
// frmCalculate
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.lblDisDiscount);
|
||||||
|
this.Controls.Add(this.lblDisPrice);
|
||||||
|
this.Controls.Add(this.lblDisQuantity);
|
||||||
|
this.Controls.Add(this.txtQuantity);
|
||||||
|
this.Controls.Add(this.txtPrice);
|
||||||
|
this.Controls.Add(this.txtDiscount);
|
||||||
|
this.Controls.Add(this.lblOut);
|
||||||
|
this.Controls.Add(this.btnCalc);
|
||||||
|
this.Controls.Add(this.miniToolStrip);
|
||||||
|
this.Controls.Add(this.mnuMain);
|
||||||
|
this.Location = new System.Drawing.Point(15, 15);
|
||||||
|
this.MainMenuStrip = this.mnuMain;
|
||||||
|
this.Name = "frmCalculate";
|
||||||
|
this.miniToolStrip.ResumeLayout(false);
|
||||||
|
this.miniToolStrip.PerformLayout();
|
||||||
|
this.mnuMain.ResumeLayout(false);
|
||||||
|
this.mnuMain.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.MenuStrip miniToolStrip;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEdit;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditCalculate;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuEditSSummary;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem windowToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuFileExit;
|
||||||
|
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
|
||||||
|
|
||||||
|
private System.Windows.Forms.MenuStrip mnuMain;
|
||||||
|
|
||||||
|
private System.Windows.Forms.TextBox txtDiscount;
|
||||||
|
private System.Windows.Forms.TextBox txtPrice;
|
||||||
|
private System.Windows.Forms.TextBox txtQuantity;
|
||||||
|
private System.Windows.Forms.Label lblDisQuantity;
|
||||||
|
private System.Windows.Forms.Label lblDisPrice;
|
||||||
|
private System.Windows.Forms.Label lblDisDiscount;
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button btnCalc;
|
||||||
|
private System.Windows.Forms.Label lblOut;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
114
MDI/frmCalculate.cs
Normal file
114
MDI/frmCalculate.cs
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
public partial class frmCalculate : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
public static decimal decDiscountAmt, decTotalPrice, decTotalAmnt = 0;
|
||||||
|
public static int intTotalQuantity = 0;
|
||||||
|
|
||||||
|
public frmCalculate()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void lblDisQuantity_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private decimal Calculate(int quantity, decimal price, decimal discount)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (quantity * price) * (1 - (discount - 100));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCalc_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int intQuantity = 0;
|
||||||
|
decimal decPrice = 0;
|
||||||
|
decimal decDiscount = 0;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
intQuantity = int.Parse(txtQuantity.Text);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
decPrice = int.Parse(txtPrice.Text);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
decDiscount = int.Parse(txtDiscount.Text);
|
||||||
|
|
||||||
|
lblOut.Text = Calculate(intQuantity, decPrice, decDiscount).ToString("C");
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
//discount error
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
//price error
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
//quantity Error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toolStripMenuItem1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mnuEditCalculate_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (mnuEditCalculate.Checked)
|
||||||
|
{
|
||||||
|
mnuEdit.Checked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mnuEditCalculate.Checked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void mnuEditSSummary_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (mnuEditSSummary.Checked)
|
||||||
|
{
|
||||||
|
mnuEditSSummary.Checked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mnuEditSSummary.Checked = true;
|
||||||
|
frmSummary frm = new frmSummary();
|
||||||
|
frm.Show();
|
||||||
|
frm.Focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
126
MDI/frmCalculate.resx
Normal file
126
MDI/frmCalculate.resx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="miniToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="mnuMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>135, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
147
MDI/frmSummary.Designer.cs
generated
Normal file
147
MDI/frmSummary.Designer.cs
generated
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
partial class frmSummary
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (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()
|
||||||
|
{
|
||||||
|
this.lblQuantity = new System.Windows.Forms.Label();
|
||||||
|
this.lblPrice = new System.Windows.Forms.Label();
|
||||||
|
this.lblDiscount = new System.Windows.Forms.Label();
|
||||||
|
this.lblTotal = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisTotal = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisDiscount = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisPrice = new System.Windows.Forms.Label();
|
||||||
|
this.lblDisQuantity = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblQuantity
|
||||||
|
//
|
||||||
|
this.lblQuantity.BackColor = System.Drawing.SystemColors.Info;
|
||||||
|
this.lblQuantity.Location = new System.Drawing.Point(298, 137);
|
||||||
|
this.lblQuantity.Name = "lblQuantity";
|
||||||
|
this.lblQuantity.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblQuantity.TabIndex = 0;
|
||||||
|
this.lblQuantity.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// lblPrice
|
||||||
|
//
|
||||||
|
this.lblPrice.BackColor = System.Drawing.SystemColors.Info;
|
||||||
|
this.lblPrice.Location = new System.Drawing.Point(298, 166);
|
||||||
|
this.lblPrice.Name = "lblPrice";
|
||||||
|
this.lblPrice.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblPrice.TabIndex = 1;
|
||||||
|
this.lblPrice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// lblDiscount
|
||||||
|
//
|
||||||
|
this.lblDiscount.BackColor = System.Drawing.SystemColors.Info;
|
||||||
|
this.lblDiscount.Location = new System.Drawing.Point(298, 195);
|
||||||
|
this.lblDiscount.Name = "lblDiscount";
|
||||||
|
this.lblDiscount.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblDiscount.TabIndex = 2;
|
||||||
|
this.lblDiscount.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// lblTotal
|
||||||
|
//
|
||||||
|
this.lblTotal.BackColor = System.Drawing.SystemColors.Info;
|
||||||
|
this.lblTotal.Location = new System.Drawing.Point(298, 224);
|
||||||
|
this.lblTotal.Name = "lblTotal";
|
||||||
|
this.lblTotal.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblTotal.TabIndex = 3;
|
||||||
|
this.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// lblDisTotal
|
||||||
|
//
|
||||||
|
this.lblDisTotal.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.lblDisTotal.Location = new System.Drawing.Point(146, 224);
|
||||||
|
this.lblDisTotal.Name = "lblDisTotal";
|
||||||
|
this.lblDisTotal.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblDisTotal.TabIndex = 7;
|
||||||
|
this.lblDisTotal.Text = "Total Sale";
|
||||||
|
this.lblDisTotal.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// lblDisDiscount
|
||||||
|
//
|
||||||
|
this.lblDisDiscount.Location = new System.Drawing.Point(146, 195);
|
||||||
|
this.lblDisDiscount.Name = "lblDisDiscount";
|
||||||
|
this.lblDisDiscount.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblDisDiscount.TabIndex = 6;
|
||||||
|
this.lblDisDiscount.Text = "Discount";
|
||||||
|
this.lblDisDiscount.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// lblDisPrice
|
||||||
|
//
|
||||||
|
this.lblDisPrice.Location = new System.Drawing.Point(146, 166);
|
||||||
|
this.lblDisPrice.Name = "lblDisPrice";
|
||||||
|
this.lblDisPrice.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblDisPrice.TabIndex = 5;
|
||||||
|
this.lblDisPrice.Text = "Price";
|
||||||
|
this.lblDisPrice.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// lblDisQuantity
|
||||||
|
//
|
||||||
|
this.lblDisQuantity.Location = new System.Drawing.Point(146, 137);
|
||||||
|
this.lblDisQuantity.Name = "lblDisQuantity";
|
||||||
|
this.lblDisQuantity.Size = new System.Drawing.Size(128, 29);
|
||||||
|
this.lblDisQuantity.TabIndex = 4;
|
||||||
|
this.lblDisQuantity.Text = "Quantity";
|
||||||
|
this.lblDisQuantity.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// frmSummary
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.lblDisTotal);
|
||||||
|
this.Controls.Add(this.lblDisDiscount);
|
||||||
|
this.Controls.Add(this.lblDisPrice);
|
||||||
|
this.Controls.Add(this.lblDisQuantity);
|
||||||
|
this.Controls.Add(this.lblTotal);
|
||||||
|
this.Controls.Add(this.lblDiscount);
|
||||||
|
this.Controls.Add(this.lblPrice);
|
||||||
|
this.Controls.Add(this.lblQuantity);
|
||||||
|
this.Name = "frmSummary";
|
||||||
|
this.Text = "frmSummary";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label lblDisTotal;
|
||||||
|
private System.Windows.Forms.Label lblDisDiscount;
|
||||||
|
private System.Windows.Forms.Label lblDisPrice;
|
||||||
|
private System.Windows.Forms.Label lblDisQuantity;
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label lblQuantity;
|
||||||
|
private System.Windows.Forms.Label lblPrice;
|
||||||
|
private System.Windows.Forms.Label lblDiscount;
|
||||||
|
private System.Windows.Forms.Label lblTotal;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
22
MDI/frmSummary.cs
Normal file
22
MDI/frmSummary.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Chapter6
|
||||||
|
{
|
||||||
|
public partial class frmSummary : Form
|
||||||
|
{
|
||||||
|
public frmSummary()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
// this.FormClosing += new FormClosingEventHandler(FrmSummary_FormClosing);
|
||||||
|
this.Activated += new EventHandler(frmSummary_Activated);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmSummary_Activated(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
MDI/frmSummary.resx
Normal file
120
MDI/frmSummary.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
Loading…
Reference in New Issue
Block a user