This commit is contained in:
EggMan20339 2024-02-06 19:44:08 -05:00
parent d288a53bec
commit 37681cbdc7
10 changed files with 793 additions and 65 deletions

View File

@ -46,14 +46,26 @@
<Reference Include="System.Xml"/> <Reference Include="System.Xml"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="frmCalculate.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="frmCalculate.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>frmCalculate.cs</DependentUpon>
</Compile>
<Compile Include="frmSummary.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmSummary.Designer.cs">
<DependentUpon>frmSummary.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs"/> <Compile Include="Program.cs"/>
<Compile Include="Properties\AssemblyInfo.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"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@ -1,40 +0,0 @@
namespace Chapter6
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.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.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Chapter6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -16,7 +16,7 @@ namespace Chapter6
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new frmCalculate());
} }
} }
} }

247
Chapter6/frmCalculate.Designer.cs generated Normal file
View 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
Chapter6/frmCalculate.cs Normal file
View 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
Chapter6/frmCalculate.resx Normal file
View 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
Chapter6/frmSummary.Designer.cs generated Normal file
View 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
Chapter6/frmSummary.cs Normal file
View 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
Chapter6/frmSummary.resx Normal file
View 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>