1234567891011121314151617181920212223242526272829 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace SmartCoalApplication.Core.CustomControl
- {
- public partial class NewTextBox : TextBox
- {
- public NewTextBox()
- {
- this.TextChanged += new EventHandler(textValueChanged);
- }
- private void textValueChanged(object sender, EventArgs e)
- {
- if (this.Text.Contains("|"))
- {
- MessageBox.Show("'|'為系統使用字符,不可輸入!");
- this.Text =this.Text.Replace("|", string.Empty);
- return;
- }
- }
- }
- }
|