Question: Assign 1: Add to the Convert project from Lab #2. Modify the Exit button. Make it so that when the user clicks on the Exit

Assign 1: Add to the Convert project from Lab #2.

Modify the Exit button. Make it so that when the user clicks on the Exit button, a message box will pop-up and ask the user, Are you sure you want to Exit? If they select the Yes button, then exit the program. Otherwise, do not exit the program.

In Lab #1 we only programmed one Event. That Event was when the User clicked on a button. In this assignment, we are going to add another event, an event on the 2 Radio buttons. Make it so that when the user selects one of the radio buttons the program will Make the opposite temperature textbox invisible so that the user cannot type in the wrong temperature. Lastly, remember to modify your code for the click event on the Convert button. Make the invisible textbox visible again.

Assign 2: Add to the Area project from Lab #1.

When the user selects the Circle radio button.make sure the top Label says Radius: and only one textbox is visible.

Then when the user clicks on the Calculate button..calculate the area of a circle and display it in the Area textbox.

When the user selects the Square radio button. make sure the top Label says Side: and only one textbox is visible.

Then when the user clicks on the Calculate button..calculate the area of a square and display it in the Area textbox.

When the user selects the Rectangle radio button. make sure the top Label says Height: and the bottom Label say Width:. and only one textbox is visible.

Then when the user clicks on the Calculate button..calculate the area of a rectangle and display it in the Area textbox.

Add an Exit button to this project. Make the exit button work.

Add a Clear button to this project. Also, make the Clear button work, clear should clear all textboxes.

Previous code:

GoTeam.Designer.cs

namespace GoTeam { partial class Form1 { ///

/// Required designer variable. ///

private System.ComponentModel.IContainer components = null;

///

/// Clean up any resources being used. ///

///true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }

#region Windows Form Designer generated code

///

/// Required method for Designer support - do not modify /// the contents of this method with the code editor. ///

private void InitializeComponent() { this.HelloLbl = new System.Windows.Forms.Label(); this.ClickBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // HelloLbl // this.HelloLbl.AutoSize = true; this.HelloLbl.BackColor = System.Drawing.SystemColors.HighlightText; this.HelloLbl.Location = new System.Drawing.Point(105, 32); this.HelloLbl.Name = "HelloLbl"; this.HelloLbl.Size = new System.Drawing.Size(62, 13); this.HelloLbl.TabIndex = 0; this.HelloLbl.Text = "Hello World"; // // ClickBtn // this.ClickBtn.BackColor = System.Drawing.Color.YellowGreen; this.ClickBtn.Location = new System.Drawing.Point(108, 193); this.ClickBtn.Name = "ClickBtn"; this.ClickBtn.Size = new System.Drawing.Size(75, 23); this.ClickBtn.TabIndex = 1; this.ClickBtn.Text = "Click Me"; this.ClickBtn.UseVisualStyleBackColor = false; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 261); this.Controls.Add(this.ClickBtn); this.Controls.Add(this.HelloLbl); this.Name = "Form1"; this.Text = "Go Team"; this.ResumeLayout(false); this.PerformLayout();

}

#endregion

private System.Windows.Forms.Label HelloLbl; private System.Windows.Forms.Button ClickBtn; } }

Convert.Designer.cs

namespace Convert { partial class Form1 { ///

/// Required designer variable. ///

private System.ComponentModel.IContainer components = null;

///

/// Clean up any resources being used. ///

///true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }

#region Windows Form Designer generated code

///

/// Required method for Designer support - do not modify /// the contents of this method with the code editor. ///

private void InitializeComponent() { this.FahrenheitLbl = new System.Windows.Forms.Label(); this.CelsiusLbl = new System.Windows.Forms.Label(); this.ConvertBtn = new System.Windows.Forms.Button(); this.ExitBtn = new System.Windows.Forms.Button(); this.CelsiusTxtBox = new System.Windows.Forms.TextBox(); this.FahrenheitTxtBox = new System.Windows.Forms.TextBox(); this.FahrtoCelsiusRdBtn = new System.Windows.Forms.RadioButton(); this.CelsiustoFahrRdBtn = new System.Windows.Forms.RadioButton(); this.SuspendLayout(); // // FahrenheitLbl // this.FahrenheitLbl.AutoSize = true; this.FahrenheitLbl.Location = new System.Drawing.Point(12, 22); this.FahrenheitLbl.Name = "FahrenheitLbl"; this.FahrenheitLbl.Size = new System.Drawing.Size(57, 13); this.FahrenheitLbl.TabIndex = 0; this.FahrenheitLbl.Text = "Fahrenheit"; // // CelsiusLbl // this.CelsiusLbl.AutoSize = true; this.CelsiusLbl.Location = new System.Drawing.Point(12, 62); this.CelsiusLbl.Name = "CelsiusLbl"; this.CelsiusLbl.Size = new System.Drawing.Size(40, 13); this.CelsiusLbl.TabIndex = 1; this.CelsiusLbl.Text = "Celsius"; // // ConvertBtn // this.ConvertBtn.Location = new System.Drawing.Point(106, 202); this.ConvertBtn.Name = "ConvertBtn"; this.ConvertBtn.Size = new System.Drawing.Size(75, 23); this.ConvertBtn.TabIndex = 2; this.ConvertBtn.Text = "Convert"; this.ConvertBtn.UseVisualStyleBackColor = true; // // ExitBtn // this.ExitBtn.Location = new System.Drawing.Point(212, 202); this.ExitBtn.Name = "ExitBtn"; this.ExitBtn.Size = new System.Drawing.Size(75, 23); this.ExitBtn.TabIndex = 3; this.ExitBtn.Text = "Exit"; this.ExitBtn.UseVisualStyleBackColor = true; // // CelsiusTxtBox // this.CelsiusTxtBox.Location = new System.Drawing.Point(81, 59); this.CelsiusTxtBox.Name = "CelsiusTxtBox"; this.CelsiusTxtBox.Size = new System.Drawing.Size(100, 20); this.CelsiusTxtBox.TabIndex = 4; // // FahrenheitTxtBox // this.FahrenheitTxtBox.Location = new System.Drawing.Point(81, 19); this.FahrenheitTxtBox.Name = "FahrenheitTxtBox"; this.FahrenheitTxtBox.Size = new System.Drawing.Size(100, 20); this.FahrenheitTxtBox.TabIndex = 5; // // FahrtoCelsiusRdBtn // this.FahrtoCelsiusRdBtn.AutoSize = true; this.FahrtoCelsiusRdBtn.Location = new System.Drawing.Point(328, 84); this.FahrtoCelsiusRdBtn.Name = "FahrtoCelsiusRdBtn"; this.FahrtoCelsiusRdBtn.Size = new System.Drawing.Size(94, 17); this.FahrtoCelsiusRdBtn.TabIndex = 6; this.FahrtoCelsiusRdBtn.TabStop = true; this.FahrtoCelsiusRdBtn.Text = "Fahr to Celsius"; this.FahrtoCelsiusRdBtn.UseVisualStyleBackColor = true; // // CelsiustoFahrRdBtn // this.CelsiustoFahrRdBtn.AutoSize = true; this.CelsiustoFahrRdBtn.Location = new System.Drawing.Point(328, 107); this.CelsiustoFahrRdBtn.Name = "CelsiustoFahrRdBtn"; this.CelsiustoFahrRdBtn.Size = new System.Drawing.Size(94, 17); this.CelsiustoFahrRdBtn.TabIndex = 7; this.CelsiustoFahrRdBtn.TabStop = true; this.CelsiustoFahrRdBtn.Text = "Celsius to Fahr"; this.CelsiustoFahrRdBtn.UseVisualStyleBackColor = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(461, 258); this.Controls.Add(this.CelsiustoFahrRdBtn); this.Controls.Add(this.FahrtoCelsiusRdBtn); this.Controls.Add(this.FahrenheitTxtBox); this.Controls.Add(this.CelsiusTxtBox); this.Controls.Add(this.ExitBtn); this.Controls.Add(this.ConvertBtn); this.Controls.Add(this.CelsiusLbl); this.Controls.Add(this.FahrenheitLbl); this.Name = "Form1"; this.Text = "Convert"; this.ResumeLayout(false); this.PerformLayout();

}

#endregion

private System.Windows.Forms.Label FahrenheitLbl; private System.Windows.Forms.Label CelsiusLbl; private System.Windows.Forms.Button ConvertBtn; private System.Windows.Forms.Button ExitBtn; private System.Windows.Forms.TextBox CelsiusTxtBox; private System.Windows.Forms.TextBox FahrenheitTxtBox; private System.Windows.Forms.RadioButton FahrtoCelsiusRdBtn; private System.Windows.Forms.RadioButton CelsiustoFahrRdBtn; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!