-
Notifications
You must be signed in to change notification settings - Fork 22
/
passwordPrompt.cs
119 lines (107 loc) · 3.82 KB
/
passwordPrompt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TurtleWallet
{
public partial class passwordPrompt : Form
{
public string walletPassword
{
get;
set;
}
public passwordPrompt()
{
InitializeComponent();
}
private void passwordText_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (passwordText.Text != "" && passwordText.Text.Length > 6)
{
walletPassword = passwordText.Text;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
private void exitButton_Click(object sender, EventArgs e)
{
DialogResult dialogResult = MessageBox.Show("Are you sure you want to cancel your Turtle Wallet creation?", "Cancel wallet creation?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
private void exitButton_MouseEnter(object sender, EventArgs e)
{
var forcolor = Color.FromArgb(39, 170, 107);
var currentButton = (Label)sender;
currentButton.ForeColor = forcolor;
}
private void exitButton_MouseLeave(object sender, EventArgs e)
{
var forcolor = Color.White;
var currentButton = (Label)sender;
currentButton.ForeColor = forcolor;
}
private void cancelButton_MouseEnter(object sender, EventArgs e)
{
var backcolor = Color.FromArgb(44, 44, 44);
var forcolor = Color.FromArgb(39, 170, 107);
var currentButton = (Label)sender;
currentButton.BackColor = backcolor;
currentButton.ForeColor = forcolor;
}
private void cancelButton_MouseLeave(object sender, EventArgs e)
{
var backcolor = Color.FromArgb(52, 52, 52);
var forcolor = Color.FromArgb(224, 224, 224);
var currentButton = (Label)sender;
currentButton.BackColor = backcolor;
currentButton.ForeColor = forcolor;
}
private void createWalletButton_MouseEnter(object sender, EventArgs e)
{
var backcolor = Color.FromArgb(44, 44, 44);
var forcolor = Color.FromArgb(39, 170, 107);
var currentButton = (Label)sender;
currentButton.BackColor = backcolor;
currentButton.ForeColor = forcolor;
}
private void createWalletButton_MouseLeave(object sender, EventArgs e)
{
var backcolor = Color.FromArgb(52, 52, 52);
var forcolor = Color.FromArgb(224, 224, 224);
var currentButton = (Label)sender;
currentButton.BackColor = backcolor;
currentButton.ForeColor = forcolor;
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult dialogResult = MessageBox.Show("Are you sure you want to cancel?", "Turtle Wallet Cancel?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
private void createWalletButton_Click(object sender, EventArgs e)
{
if(passwordText.Text != "")
{
walletPassword = passwordText.Text;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
}