zoukankan      html  css  js  c++  java
  • 窗口上的工具提示

    介绍 在windows世界工具提示从用户的角度,是非常重要的 开发人员用来为用户提供此工具。正如我们所知,MFC 不提供工具提示窗口的一部分(它提供了工具提示 源将有助于控制)这给工具提示指定 地区的窗口。这是对那些处理非常有用 图纸,因为通过这个他们可以给他们的图纸工具提示。 如何使用源代码吗 在您的项目包括以下文件 WindowTip.h WindowTip.cpp 首先创建工具提示窗口一旦你创建你的父母 窗口你想显示工具提示 隐藏,复制Code

    CWindowTip m_MyTip; // Create the object
    m_MyTip.SetDelay(1000); // Set the Display delay
    m_MyTip.CreateTipWnd(this); // Create the Window

    现在叫ShowTip函数在父窗口的鼠标移动 隐藏,复制Code

    m_MyTip.ShowTip(point); // Pass current mouse position

    现在增加了提示您想要添加通过使用下面的方法。 1. CTipInfo创建一个对象 2. 设置区域和文本提示使用SetReagion和隐藏,复制Code

    SetText

    3.最后添加这个使用AddTip CWindowTip的方法 隐藏,复制Code

    CTipInfo info(CRect(0, 0, 100, 100),
                  "Top Left corner of Window");
    m_MyTip.AddTip(info);   
    
    // specifies bottom right corner of window
    CRect t_rect;
    GetClientRect(&t_rect); // Gets the Parent 
                            // Window Client area
    t_rect.top = t_rect.bottom - 100 ;
    t_rect.left = t_rect.right - 100 ;
    info.SetReagion(t_rect);
    info.SetText("Bottom Right corner of Window");
    m_MyTip.AddTip(info);
    
    // specifies middle area of window
    t_rect.top  = t_rect.bottom / 2 - 50;
    t_rect.left = t_rect.right / 2 - 50;
    t_rect.bottom = t_rect.top + 100;
    t_rect.right = t_rect.left + 100;
    info.SetReagion(t_rect);
    info.SetText("Middle area of window");
    m_MyTip.AddTip(info);

    如何使用演示项目吗 只要双击ToolTip.exe双击窗口设置工具提示将鼠标移动到左上角,窗口的中间和右侧的角落 ,等待第二个。 未来的工作…… 使用矩形区域,而不是提供字体,笔和刷定制小链接给小费 本文转载于:http://www.diyabc.com/frontweb/news6710.html

  • 相关阅读:
    ASP.NET 缓存技术分析
    asp.net中两款文本编辑器NicEdit和Kindeditor
    VS2005,VS2008,VS2010将ASP.NET网站编译成一个DLL文件
    公共的Json操作C#类
    怎么把100多个EXCEL文件合并成一个
    C# ToString()方法一些特殊用法
    C# 将数据导出到Execl汇总
    ASP.NET MVC中在Action获取提交的表单数据方法总结
    vue实现锚点定位跳转(当前页面跳转,url不变)
    es6 去除小数点后,不四舍五入
  • 原文地址:https://www.cnblogs.com/Dincat/p/13467420.html
Copyright © 2011-2022 走看看