1. Create a Form that contains two buttons, one labeled Stop and one labeled Go. Add a label telling the user to click a button. When the user clicks Stop, change the BackColor of the Form to Red; when the user clicks Go, change the BackColor of the Form to Green.
namespace Practical8
{
publicpartialclassForm1 : Form { public Form1() {
InitializeComponent();
}
privatevoidbuttonStop_Click(object sender, EventArgs e) { this.BackColor = Color.Red; }
privatevoidbuttonGo_Click(object sender, EventArgs e) { this.BackColor = Color.Green; } }
}
2. Create a Windows application that contains a button labeled OK and a textbox labeled Name. Change the …show more content…
Create a Windows application that contains two textboxes and two buttons. One of thetextboxes and one of the buttons are initially invisible. The first textbox should be used to input a password. The textbox should be masked to some character of your choice so that the characters entered by the user are not seen on the screen. When the user clicks the first button, the second textbox and button should be displayed with a prompt asking the user to reenter his or her password. Now, when the user clicks the second button, have the application compare the values entered to make sure they are the same. Display an appropriate message indicating whether they are the …show more content…
}
//calculate the new balance publicvoidDetermineNewBal() { newBalance = balance + deposit - withdrawal; } }
}
//GUI using System; usingSystem.Collections.Generic; usingSystem.ComponentModel; usingSystem.Data; usingSystem.Drawing; usingSystem.Linq; usingSystem.Text; usingSystem.Windows.Forms; namespace Practical_8
{
publicpartialclassForm1 : Form { public Form1() {
InitializeComponent();
}
privatevoidbuttonEnter_Click(object sender, EventArgs e) { doublebal = double.Parse(balance.Text); doublewdw = double.Parse(withdrawal.Text); doubledps = double.Parse(deposit.Text);
BankingAccountbankAcc = newBankingAccount(bal, wdw, dps);
newBal.Text = bankAcc.NewBalance.ToString("C");
name.Enabled = false; accNumber.Enabled = false; balance.Enabled = false; withdrawal.Enabled = false; deposit.Enabled = false; label1.Visible = true; labelNewBal.Visible = true; newBal.Visible = true; newBal.Enabled = false; } }