mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-22 13:50:14 +00:00
42 lines
No EOL
1.2 KiB
C#
42 lines
No EOL
1.2 KiB
C#
using DarkUI.Forms;
|
|
using MSFSPopoutPanelManager.UIController;
|
|
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace MSFSPopoutPanelManager.UI
|
|
{
|
|
public partial class AddProfileForm : DarkForm
|
|
{
|
|
public AddProfileForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public string ProfileName { get { return textBoxProfileName.Text.Trim(); } }
|
|
|
|
private void textBoxProfileName_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
e.Handled = !(Char.IsLetterOrDigit(e.KeyChar) ||
|
|
Char.IsPunctuation(e.KeyChar) ||
|
|
e.KeyChar == (char)Keys.Space ||
|
|
e.KeyChar == (char)Keys.Back);
|
|
}
|
|
|
|
private void textBoxProfileName_TextChanged(object sender, EventArgs e)
|
|
{
|
|
buttonOK.Enabled = textBoxProfileName.Text.Trim().Length > 0;
|
|
}
|
|
|
|
private void buttonCancel_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.Cancel;
|
|
Close();
|
|
}
|
|
|
|
private void buttonOK_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
}
|
|
} |