C#的tooltip自动消失之后就不再显示了解决办法
2013-07-04 22:17
585 查看
转:http://www.51testing.com/?uid-569418-action-viewspace-itemid-832231
在控件上加上tooltip之后,鼠标放到控件上,tooltip出来,等tooltip自动消失之后,再将鼠标放到控件上去时就不会再显示tooltip了
解决方法:给tooltip加上MouseEnter 和MouseLeave的事件,在事件里面设置tooltip的Active状态
Label label= new Label();
ToolTip toolTip1 = new ToolTip();
toolTip1.AutoPopDelay = 5000;
toolTip1.InitialDelay = 500;
toolTip1.ReshowDelay = 500;
toolTip1.ShowAlways = true;
toolTip1.SetToolTip(this.label, "提示的内容");
toolTip1.ToolTipTitle = "提示的标题";
label.MouseEnter += new System.EventHandler(this.toolTip1_MouseEnter);
label.MouseLeave += new System.EventHandler(this.toolTip1_MouseLeave);
private void toolTip1_MouseEnter(object sender, EventArgs e)
{
this.toolTip1.Active = true;
}
private void toolTip1_MouseLeave(object sender, EventArgs e)
{
this.toolTip1.Active = false;
}
在控件上加上tooltip之后,鼠标放到控件上,tooltip出来,等tooltip自动消失之后,再将鼠标放到控件上去时就不会再显示tooltip了
解决方法:给tooltip加上MouseEnter 和MouseLeave的事件,在事件里面设置tooltip的Active状态
Label label= new Label();
ToolTip toolTip1 = new ToolTip();
toolTip1.AutoPopDelay = 5000;
toolTip1.InitialDelay = 500;
toolTip1.ReshowDelay = 500;
toolTip1.ShowAlways = true;
toolTip1.SetToolTip(this.label, "提示的内容");
toolTip1.ToolTipTitle = "提示的标题";
label.MouseEnter += new System.EventHandler(this.toolTip1_MouseEnter);
label.MouseLeave += new System.EventHandler(this.toolTip1_MouseLeave);
private void toolTip1_MouseEnter(object sender, EventArgs e)
{
this.toolTip1.Active = true;
}
private void toolTip1_MouseLeave(object sender, EventArgs e)
{
this.toolTip1.Active = false;
}
相关文章推荐
- toolTip自动消失之后不再显示的解决方法
- C#中在按钮上放置ToolTip,点击按钮后tooltip不能显示的解决办法
- XP的系统防火墙不能用,自动更新显示灰色的解决办法
- 【JQUERY】默认样式添加之后自动添加click事件的解决办法
- VS2008 类方法 按点后自动提示功能消失的解决办法
- 关于VirtualBox自动挂载文件不显示的解决办法
- Eclipse装了插件之后插件没反应启用不了或不显示问题的解决办法
- html文件修改后缀为aspx之后在ie6中格式显示不正确问题的解决办法
- C#开发——窗体去边框之后无法移动解决办法
- C# datetime.now.tostring("yyyy/MM/dd") 显示为yyyy-MM-dd的解决办法
- swiper隐藏后再显示不会触发自动播放解决办法
- 在word中插入内容时自动删除之后的内容解决办法
- 联想thinkpad E430c 重装系统之后无线连接显示红叉解决办法
- 使用WebBrowser打开Powerpoint时只自动显示前两页的解决办法
- div或li float之后父容器高度不能自动增加的解决办法
- 电脑重启之后流氓软件自动安装之完美解决办法
- 安装wampserver之后,浏览器中输入localhost页面显示IIS7解决办法
- iPhone html5页面 手机号码不显示,显示一下后又消失解决办法
- c# Gridview 自动分页功能 解决后面页面不显示问题
- 使用代理之后谷歌浏览器翻译网页成功但还是显示英文的解决办法