这是一个自定义控件,继承了TextBox,在TextBox基础上添加了4个属性(下载): 1.ControlType 文本框需要验证的类型 2.ControlTypeText 显示的文字(只读) 3.IsNULL 填写的内容是否可空 4.IsPass 格式是否正确(在文本框失去焦点时验证,只读) 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sys
有时候我们需要弹出个提示框然后让它自己关闭,然而实际使用中的弹出框确实阻塞进程,网上貌似有一种另类的解决方式,大致思路是把弹出框放到另外的一个窗体上,直接贴代码 主窗体 using System; using System.Windows.Forms; namespace WinForm { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void button
delegate void SetTextCallback(string text); private void showClientMsg(string text) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns tr