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

This commit is contained in:
2026-01-29 19:38:04 -05:00
parent 77c6298067
commit 35eb05432b
8 changed files with 36 additions and 144 deletions

View File

@@ -77,6 +77,7 @@ using System.Xml.Schema;
using System.Text;
using ROFields;
using RODBInterface;
using System.Linq;
namespace ROEditor
{
@@ -594,31 +595,15 @@ namespace ROEditor
}
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)
if (clpBrd.Any(c => c > 166))
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}
}
}

View File

@@ -77,6 +77,7 @@ using System.Xml.Schema;
using System.Text;
using ROFields;
using RODBInterface;
using System.Linq;
namespace ROEditor
{
@@ -321,24 +322,14 @@ namespace ROEditor
bool symFlg = false;
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
string clpBrd = Clipboard.GetText();
char[] chrAry = clpBrd.ToCharArray();
foreach (int chr in chrAry)
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
if (chr > 166)
string clpBrd = Clipboard.GetText();
if (clpBrd.Any(c => c > 166))
{
symFlg = true;
break;
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}

View File

@@ -72,6 +72,7 @@ using System.Xml;
using System.Text;
using RODBInterface;
using ROFields;
using System.Linq;
namespace ROEditor
{
@@ -282,24 +283,14 @@ namespace ROEditor
bool symFlg = false;
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
string clpBrd = Clipboard.GetText();
char[] chrAry = clpBrd.ToCharArray();
foreach (int chr in chrAry)
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
if (chr > 166)
string clpBrd = Clipboard.GetText();
if (clpBrd.Any(c => c > 166))
{
symFlg = true;
break;
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}

View File

@@ -52,6 +52,7 @@ using System.Xml;
using System.Text;
using ROFields;
using RODBInterface;
using System.Linq;
namespace ROEditor
{
@@ -423,28 +424,17 @@ namespace ROEditor
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 (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
if (chr > 166)
string clpBrd = Clipboard.GetText();
if (clpBrd.Any(c => c > 166))
{
symFlg = true;
break;
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}

View File

@@ -106,6 +106,7 @@ using ROFields;
using RODBInterface;
using VlnStatus;
using System.Collections.Generic;
using System.Linq;
namespace ROEditor
@@ -1316,24 +1317,14 @@ namespace ROEditor
bool symFlg = false;
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
string clpBrd = Clipboard.GetText();
char[] chrAry = clpBrd.ToCharArray();
foreach (int chr in chrAry)
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
if (chr > 166)
string clpBrd = Clipboard.GetText();
if (clpBrd.Any(c => c > 166))
{
symFlg = true;
break;
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}