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

@@ -155,6 +155,7 @@ namespace ROEditor
this.tbGroup.Size = new System.Drawing.Size(248, 22);
this.tbGroup.TabIndex = 8;
this.tbGroup.Text = "";
this.tbGroup.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// lblGroup
//
@@ -421,5 +422,31 @@ namespace ROEditor
GroupDefFrm grdef = new GroupDefFrm(nelem,myrodb,nelem.InnerText,dbtype);
grdef.ShowDialog();
}
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();
}
}
}
}
}