2016-01-06 14:47:38 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
2016-01-09 20:46:25 +00:00
|
|
|
|
namespace Crypto_Notepad
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
2018-12-17 11:13:42 +00:00
|
|
|
|
public partial class EnterKeyForm : Form
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
2018-12-17 11:13:42 +00:00
|
|
|
|
public EnterKeyForm()
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
2018-11-22 06:19:39 +00:00
|
|
|
|
// Initialize to false in case user presses the exit button
|
2018-12-17 11:04:26 +00:00
|
|
|
|
PublicVar.okPressed = false;
|
2016-01-06 14:47:38 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2018-12-17 11:04:26 +00:00
|
|
|
|
TypedPassword.Value = textBox1.Text;
|
2016-01-06 14:47:38 +00:00
|
|
|
|
textBox1.Focus();
|
2018-12-17 11:04:26 +00:00
|
|
|
|
PublicVar.okPressed = true;
|
2016-01-06 14:47:38 +00:00
|
|
|
|
this.Hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void textBox1_TextChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (textBox1.Text.Length > 0)
|
|
|
|
|
|
button1.Enabled = true;
|
|
|
|
|
|
else
|
|
|
|
|
|
button1.Enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void textBox1_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
|
{
|
2018-12-13 11:31:05 +00:00
|
|
|
|
if (e.KeyCode == Keys.Enter && button1.Enabled)
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
button1_Click(sender, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void pictureBox1_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2018-12-09 14:08:07 +00:00
|
|
|
|
if (textBox1.UseSystemPasswordChar)
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
textBox1.UseSystemPasswordChar = false;
|
2018-12-09 14:08:07 +00:00
|
|
|
|
pictureBox1.Image = Properties.Resources.eye;
|
2016-01-06 14:47:38 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-12-09 14:08:07 +00:00
|
|
|
|
if (!textBox1.UseSystemPasswordChar)
|
2016-01-06 14:47:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
textBox1.UseSystemPasswordChar = true;
|
2018-12-09 14:08:07 +00:00
|
|
|
|
pictureBox1.Image = Properties.Resources.eye_half;
|
2016-01-06 14:47:38 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-01-09 19:29:13 +00:00
|
|
|
|
|
|
|
|
|
|
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
textBox1.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-05 20:47:31 +00:00
|
|
|
|
private void Form2_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2018-12-17 11:04:26 +00:00
|
|
|
|
this.Text = PublicVar.openFileName;
|
2017-02-05 20:47:31 +00:00
|
|
|
|
}
|
2016-01-06 14:47:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|