这个要用到正则表达式的类,你在msdn中搜索“regular”,或者在csdn中搜索“正则表达式”,看一下你就会明白的,

解决方案 »

  1.   


     参考以下: http://expert.csdn.net/Expert/topic/1930/1930163.xml?temp=.9402124
      

  2.   

    你可以在事件LostFocus中控制。
    public void comboBox1_LostFocus(Object send, EventArgs e) {
    //控制文本
    String str = this.comboBox1.Text;
    Regex reg = new Regex("((([0-1][0-9])|(2[0-3])):[0-5][0-9])");
    Match ma = reg.Match(str);
    if (!ma.Success || ma.Value != str) {
      this.comboBox1.Text = "";
    }
    }