• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
APS-叶童
博客园    首页    新随笔    联系   管理    订阅  订阅

ToolTipController 事件触发显示时 避免闪烁的处理方法

private DevExpress.Utils.ToolTipController toolTipController1;
private DevExpress.Utils.ToolTipController toolTipController2;
private ToolTipControllerShowEventArgs args;

 

/// add by Tony 2016/4/5
this.toolTipController1 = new DevExpress.Utils.ToolTipController();
this.toolTipController1.AllowHtmlText = true;
this.toolTipController1.AutoPopDelay = 50000;
this.toolTipController1.CloseOnClick = DevExpress.Utils.DefaultBoolean.True;
this.toolTipController1.ShowBeak = true;
this.toolTipController1.ToolTipLocation = DevExpress.Utils.ToolTipLocation.RightCenter;
this.toolTipController1.ToolTipStyle = DevExpress.Utils.ToolTipStyle.Windows7;
this.toolTipController1.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;
/// add by Tony 2016/4/6
this.toolTipController2 = new DevExpress.Utils.ToolTipController();
this.toolTipController2.AllowHtmlText = true;
this.toolTipController2.AutoPopDelay = 50000;
this.toolTipController2.CloseOnClick = DevExpress.Utils.DefaultBoolean.True;
this.toolTipController2.ShowBeak = true;
this.toolTipController2.ToolTipLocation = DevExpress.Utils.ToolTipLocation.RightCenter;
this.toolTipController2.ToolTipStyle = DevExpress.Utils.ToolTipStyle.Windows7;
this.toolTipController2.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;

 

private void Gantt_OnTimeItemAreaMouseMove(object sender, MouseEventArgs e)
{
if (args == null)
{

args = CreateShowArgs(sbuText.ToString());
// 显示ToolTip 这里不可以用控件的坐标.要用屏幕的坐标Control.MousePosition
toolTipController2.ShowHint(args, System.Windows.Forms.Control.MousePosition);
}
}

 

public void Gantt_OnTimeItem_Hoover(Gantt aGantt, TimeItemEventArgs e)
{
if (e.TimeItem == null)
{
toolTipController1.HideHint();
args = null;
return;
}

if (sbuText.Length > 0)
{
// 获取显示ToolTip事件实例
args = CreateShowArgs(sbuText.ToString());
// 显示ToolTip 这里不可以用控件的坐标.要用屏幕的坐标Control.MousePosition
toolTipController1.ShowHint(args, System.Windows.Forms.Control.MousePosition);
}
sbuText.Length = 0;
}

posted @ 2016-04-08 11:43  所念所想亦如是  阅读(1623)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3