日期:2014-05-16  浏览次数:20848 次

WinFrom如何实现TextBox显示帮助信息.....
C#或者VB.Net如何让TextBox实现在获取焦点时显示帮助信息,帮助信息显示的方式如下图:

------解决方案--------------------
引用:
Quote: 引用:

tooltip

我说的是如何让TextBox获取焦点时显示图上显示的那个小框...


mousehover   里面  show  
------解决方案--------------------
        
        private readonly ToolTip toolTip1 = new ToolTip  //申明ToolTip 
            {
                AutoPopDelay = 5000,
                ShowAlways = true,
                Active = true
            };   
        textBox1.GotFocus += textBox1_GotFocus;     //注册事件
        void textBox1_GotFocus(object sender, EventArgs e)
        {
            toolTip1.SetToolTip(textBox1, "一卡通信息维护");
        }

楼主结贴吧
------解决方案--------------------
引用:
Quote: 引用:

        
        private readonly ToolTip toolTip1 = new ToolTip  //申明ToolTip 
            {
                AutoPopDelay = 5000,
                ShowAlways = true,
                Active = true
            };   
        textBox1.GotFocus += textBox1_GotFocus;     //注册事件
        void textBox1_GotFocus(object sender, EventArgs e)
        {
            toolTip1.SetToolTip(textBox1, "一卡通信息维护");
        }

楼主结贴吧

显示的帮助信息的位置没办法控制吗?


把 toolTip1.SetToolTip(textBox1, "一卡通信息维护"); 换成下面,不过好像自动消失就不起作用了
            var point = new Point(100,100);  //你所需要的位子
            toolTip1.Show("一卡通信息维护", listMunu, point); 
------解决方案--------------------
引用:
Quote: 引用: