finish??
This commit is contained in:
55
HCI_Coursework_EVCHARGE/Pinpad.cs
Normal file
55
HCI_Coursework_EVCHARGE/Pinpad.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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 HCI_Coursework_EVCHARGE
|
||||
{
|
||||
public partial class Pinpad : Form
|
||||
{
|
||||
TextBox entryBox;
|
||||
|
||||
public Pinpad()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.TopMost = true;
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
}
|
||||
|
||||
public void setTextBox(TextBox textBox)
|
||||
{
|
||||
entryBox = textBox;
|
||||
}
|
||||
|
||||
private void backspace_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (entryBox.Text.Length > 0)
|
||||
{
|
||||
entryBox.Text = entryBox.Text.Substring(0, entryBox.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void confirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void button_Click(object sender, EventArgs e)
|
||||
{
|
||||
if ( entryBox.Text.Length < 6 )
|
||||
{
|
||||
entryBox.Text += ((Button)sender).Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("PIN cannot be more than 6 numbers!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user