-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPasswordInputForm.cs
More file actions
34 lines (31 loc) · 1.07 KB
/
PasswordInputForm.cs
File metadata and controls
34 lines (31 loc) · 1.07 KB
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
public partial class PasswordInputForm : Form
{
static string returnval;
public PasswordInputForm()
{
InitializeComponent();
}
public static string ShowForm(OpeningResults condition)
{
PasswordInputForm newPIF = new PasswordInputForm();
returnval = null;
if (condition == OpeningResults.PasswordNeeded) newPIF.label1.Text = "A password is needed to open this level.";
else if (condition == OpeningResults.WrongPassword) newPIF.label1.Text = "Sorry, wrong password. Please try again.";
newPIF.ShowDialog();
return returnval;
}
private void ButtonOK_Click(object sender, EventArgs e)
{
returnval = textBox1.Text;
Dispose();
}
private void ButtonCancel_Click(object sender, EventArgs e) { Dispose(); }
}