Kész a feladat megoldása.

This commit is contained in:
István Priskin 2023-01-20 17:29:03 +01:00
parent 2c6d5ae216
commit f3d40ef94e
2 changed files with 43 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace Merkozesek
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
@ -139,7 +140,7 @@ namespace Merkozesek
//
// button2
//
this.button2.Location = new System.Drawing.Point(204, 405);
this.button2.Location = new System.Drawing.Point(204, 421);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 11;
@ -147,11 +148,32 @@ namespace Merkozesek
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoScroll = true;
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.Location = new System.Drawing.Point(24, 242);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 8;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(375, 157);
this.tableLayoutPanel1.TabIndex = 12;
//
// StatisztikaForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(483, 456);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.button2);
this.Controls.Add(this.label5);
this.Controls.Add(this.textBox4);
@ -186,5 +208,6 @@ namespace Merkozesek
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

View File

@ -39,12 +39,31 @@ namespace Merkozesek
int hgy = 0;
int vgy = 0;
int golszumma = 0;
stlista.ForEach(sm => {
if (sm.HazaiRugott > sm.VendegRugott) hgy++;
if (sm.HazaiRugott < sm.VendegRugott) vgy++;
golszumma += (sm.HazaiRugott + sm.VendegRugott);
});
textBox3.Text = hgy.ToString();
textBox4.Text = vgy.ToString();
foreach (var sm in stlista)
{
double smgol = (sm.HazaiRugott + sm.VendegRugott);
double arany = (smgol / golszumma) * 100;
Label cscimke = new Label();
cscimke.AutoSize = true;
cscimke.Text = sm.ToString();
tableLayoutPanel1.Controls.Add(cscimke);
Label acimke = new Label();
acimke.AutoSize = true;
acimke.Text = arany.ToString("F2")+" %";
tableLayoutPanel1.Controls.Add(acimke);
}
}
catch (Exception)
{