Sunteți pe pagina 1din 2

// namespaces used in this project 1st part

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

using System.Text;
using System.Windows.Forms;
//namespaces end

namespace ecryption___decryption_data
{

public partial class Form1 : Form


{
public Form1()
{
InitializeComponent();
//design begun
textBox3.PasswordChar = '*';
this.richTextBox1.Visible = false;
this.richTextBox2.Visible = false;
this.button4.Visible = false;
this.label3.Visible = false;
this.textBox4.Visible = false;
// end design
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)


{
// desing begun
if (checkBox1.Checked == true)
{
checkBox2.Enabled = false;
this.button3.Text = "Encryption";
this.button3.Image = global::ecryption___decryption_data.Properties.Resources.locked_lock;
this.button4.Text = "Encryption";
this.button4.Image = global::ecryption___decryption_data.Properties.Resources.locked_lock;
this.label2.Text = "Encryption operation was chosen";

}
else if (checkBox1.Checked == false)
{
checkBox2.Enabled = true;
}
// end desing
}

private void checkBox2_CheckedChanged(object sender, EventArgs e)


{
// desing begun
if (checkBox2.Checked == true)
{
checkBox1.Enabled = false;
this.button3.Text = "Decryption";
this.button3.Image =
global::ecryption___decryption_data.Properties.Resources.unlocked_lock;
this.button4.Text = "Decryption";
this.button4.Image =
global::ecryption___decryption_data.Properties.Resources.unlocked_lock;
this.label2.Text = "Decryption operation was chosen";

}
else if (checkBox1.Checked == false)
{
checkBox1.Enabled = true;
}
// end desing
}

private void checkBox3_CheckedChanged(object sender, EventArgs e)


{

//design begun
if (checkBox3.Checked == true)
{

textBox4.PasswordChar = '*';
this.richTextBox1.Visible = true;
this.richTextBox2.Visible = true;
this.button4.Visible = true;
this.label3.Visible = true;
this.textBox4.Visible = true;
//**********************************
this.button1.Visible = false;
this.button2.Visible = false;
this.button3.Visible = false;
this.textBox1.Visible = false;
this.textBox2.Visible = false;
this.textBox3.Visible = false;
this.label1.Visible = false;
//End design
}
else if (checkBox3.Checked == false)
{
this.richTextBox1.Visible = false;
this.richTextBox2.Visible = false;
this.button4.Visible = false;
this.label3.Visible = false;
this.textBox4.Visible = false;
//**********************************
this.button1.Visible = true;
this.button2.Visible = true;
this.button3.Visible = true;
this.textBox1.Visible = true;
this.textBox2.Visible = true;
this.textBox3.Visible = true;
this.label1.Visible = true;
}

//End design
}
}
}

S-ar putea să vă placă și