C2022-003-Change-Textboxes-to-RTF-3
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user