Files
Groupware/Project/Dialog/fPassword.cs
2024-05-08 14:53:55 +09:00

42 lines
1.1 KiB
C#

using FCOMMON;
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;
namespace Project.Dialog
{
public partial class fPassword : fBase
{
public fPassword()
{
InitializeComponent();
this.tbInput.KeyDown += (s1, e1) => { if (e1.KeyCode == Keys.Enter) btLogin.PerformClick(); };
this.KeyPreview = true;
this.KeyDown += (s1, e1) => {
if (e1.KeyCode == Keys.Escape) this.Close();
};
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
EnsureVisibleAndUsableSize();
}
private void button1_Click(object sender, EventArgs e)
{
string id = tbInput.Text.Trim();
if (id.isEmpty())
{
tbInput.Focus();
return;
}
DialogResult = DialogResult.OK;
}
}
}