This commit is contained in:
2022-11-15 14:22:17 -06:00
parent c2062a2a38
commit ab09a46923
268 changed files with 1961 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
namespace lab6_1_CalebFontenot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
bool isLit = false;
private void switchButton_Click(object sender, EventArgs e)
{
// Update the light state according to what state we are currently in
if (isLit)
{
isLit = false;
} else
{
isLit = true;
}
lightState(isLit);
}
private void lightState(bool lightState)
{
if (lightState)
{
// Update the label
lightStateLabel.Text = "ON";
// Update the image.
lightPictureBox.Image = Properties.Resources.LightOn;
}
else
{
// Update the label
lightStateLabel.Text = "OFF";
// Update the image.
lightPictureBox.Image = Properties.Resources.LightOff;
}
}
}
}