WinFrom如何实现TextBox显示帮助信息.....

鏡椛氹鈅 2014-03-21 09:33:49
C#或者VB.Net如何让TextBox实现在获取焦点时显示帮助信息,帮助信息显示的方式如下图:
...全文
170 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
从_零_开始 2014-03-21
  • 打赏
  • 举报
回复
引用 6 楼 m1654399928 的回复:
[quote=引用 5 楼 u012804018 的回复:] [quote=引用 4 楼 m1654399928 的回复:] 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] 把 toolTip1.SetToolTip(textBox1, "一卡通信息维护"); 换成下面,不过好像自动消失就不起作用了 var point = new Point(100,100); //你所需要的位子 toolTip1.Show("一卡通信息维护", listMunu, point); [/quote] 将 toolTip1.Show("一卡通信息维护", listMunu, point)换成 toolTip1.Show("双击鼠标打开菜单", listMunu, point, time); 最后面加一个time的参数,表示需要显示的时间,time是Int类型
欢乐的小猪 2014-03-21
  • 打赏
  • 举报
回复
ToolTip 还可以设置显示的位置
从_零_开始 2014-03-21
  • 打赏
  • 举报
回复
引用 5 楼 u012804018 的回复:
[quote=引用 4 楼 m1654399928 的回复:] 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] 把 toolTip1.SetToolTip(textBox1, "一卡通信息维护"); 换成下面,不过好像自动消失就不起作用了 var point = new Point(100,100); //你所需要的位子 toolTip1.Show("一卡通信息维护", listMunu, point);
鏡椛氹鈅 2014-03-21
  • 打赏
  • 举报
回复
引用 4 楼 m1654399928 的回复:
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, "一卡通信息维护"); } 楼主结贴吧
显示的帮助信息的位置没办法控制吗?
从_零_开始 2014-03-21
  • 打赏
  • 举报
回复
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, "一卡通信息维护"); } 楼主结贴吧
失落的神庙 2014-03-21
  • 打赏
  • 举报
回复
引用 2 楼 u012804018 的回复:
[quote=引用 1 楼 wawd74520 的回复:] tooltip
我说的是如何让TextBox获取焦点时显示图上显示的那个小框...[/quote] mousehover 里面 show
鏡椛氹鈅 2014-03-21
  • 打赏
  • 举报
回复
引用 1 楼 wawd74520 的回复:
tooltip
我说的是如何让TextBox获取焦点时显示图上显示的那个小框...
失落的神庙 2014-03-21
  • 打赏
  • 举报
回复
tooltip

110,530

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧