我也想在我的winform的textbox里实现这种提示,特别是验证数据时在该textbox出显示这种提示框,因为用messagebox太老土了,不知道怎么实现?tooltip好像不好控制

解决方案 »

  1.   

    有一个ErrorProvider控件,你试试!
      

  2.   

    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystemwindowsformstooltipclasstopic.htm
      

  3.   

    ErrorProvider控件
    比方说我要验证textbox空间的内容,代码如下            if (rdoStudentID.Checked == true && txtStudentID.TextLength != 9 && txtStudentID.TextLength > 0)
                {
                    errStudentID.SetIconAlignment((Control)sender, ErrorIconAlignment.MiddleRight);
                    errStudentID.SetError((Control)sender, "学号输入有误");
                    e.Cancel = true;
                    SystemSounds.Exclamation.Play();
                    txtStudentID.Text = "";
                }
                else
                {
                    errStudentID.SetError((Control)sender, "");
                }
      

  4.   

    juge001(宰相) 介绍的页面怎么打不开啊?
      

  5.   

    toolTip出现的位置能控制不?
      

  6.   

    不客气,你可以到微软的MSDN网站上看一下
    http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpref/html/frlrfsystemwindowsformstooltipclasstopic.asp
      

  7.   

    能让toolTip不自己弹出来,而只有我来toolTip.Show(TextBox1,"hello");它才弹出来吗?