C2022-003-Change-Textboxes-to-RTF-3

This commit is contained in:
2026-01-28 14:47:00 -05:00
parent 0ae45eb918
commit 77c6298067
9 changed files with 295 additions and 20 deletions

View File

@@ -316,6 +316,32 @@ namespace ROEditor
}
base.Dispose( disposing );
}
private void txtBox_KeyDown(object sender, KeyEventArgs e)
{
bool symFlg = false;
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
string clpBrd = Clipboard.GetText();
char[] chrAry = clpBrd.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 166)
{
symFlg = true;
break;
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}
#region Windows Form Designer generated code
/// <summary>
@@ -357,6 +383,7 @@ namespace ROEditor
this.tbFieldName.Size = new System.Drawing.Size(320, 22);
this.tbFieldName.TabIndex = 2;
this.tbFieldName.Text = "";
this.tbFieldName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// tbWidth
//
@@ -365,6 +392,7 @@ namespace ROEditor
this.tbWidth.Size = new System.Drawing.Size(32, 22);
this.tbWidth.TabIndex = 3;
this.tbWidth.Text = "";
this.tbWidth.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// btnOK
//
@@ -402,6 +430,7 @@ namespace ROEditor
this.tbPattern.TabIndex = 7;
this.tbPattern.Text = "";
this.tbPattern.Visible = false;
this.tbPattern.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// FieldTextFrm
//