Question: So I get back errors using this code: using System; using System.Windows.Forms; namespace RaisingSalaryGUI { public partial class Form 1 : Form { public Form
So I get back errors using this code:
using System;
using System.Windows.Forms;
namespace RaisingSalaryGUI
public partial class Form : Form
public Form
InitializeComponent;
private partial void Buttonclickobject sender EventArgs e;
namespace ProjectedRaisesGUI
public class Form : Form
private readonly Label lblCurrentSalary;
private readonly TextBox txtCurrentSalary;
private readonly Button btnCalculate;
private Label lblResult;
public Form
lblCurrentSalary new Label;
txtCurrentSalary new TextBox;
btnCalculate new Button;
lblResult new Label;
lblCurrentSalary.Text "Current Salary";
lblCurrentSalary.Location new System.Drawing.Point;
lblCurrentSalary.AutoSize true;
txtCurrentSalary.Location new System.Drawing.Point;
txtCurrentSalary.Width ;
btnCalculate.Text "Calculate";
btnCalculate.Location new System.Drawing.Point;
btnCalculate.Click new System.EventHandlerBtnCalculateClick;
lblResult.Location new System.Drawing.Point;
lblResult.AutoSize true;
this.Controls.AddlblCurrentSalary;
this.Controls.AddtxtCurrentSalary;
this.Controls.AddbtnCalculate;
this.Controls.AddlblResult;
this.Text "Projected Salary Calculator";
this.StartPosition FormStartPosition.CenterScreen;
this.Size new System.Drawing.Size;
private void BtnCalculateClickobject sender System.EventArgs e
try
double currentSalary System.Convert.ToDoubletxtCurrentSalaryText;
double increaseRate ;
double projectedSalary currentSalary increaseRate;
lblResult.Text $"New Salary $projectedSalary:F;
catch SystemFormatException
MessageBox.ShowPlease enter a valid number for the salary.", "Input Error", MessageBoxButtons.OK MessageBoxIcon.Error;
SystemSTAThread
static void Main
Application.EnableVisualStyles;
Application.SetCompatibleTextRenderingDefaultfalse;
Application.Runnew Form;
and these are the errors:
Severity Code Description Project File Line Suppression State
Error active CS Program has more than one entry point defined. Compile with main to specify the type that contains the entry point.
Severity Code Description Project File Line Suppression State
Error active CS Partial method 'FormButtonclickobject EventArgs must have an implementation part because it has accessibility modifiers.
Severity Code Description Project File Line Suppression State
Error active CS Feature 'extended partial methods' is not available in C# Please use language version or greater.
Severity Code Description Project File Line Suppression State
Error active CS Cannot create delegate from method 'FormButtonclickobject EventArgs because it is a partial method without an implementing declaration
It has to be in C#
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
