zoukankan      html  css  js  c++  java
  • CButton与图标

    介绍 我们的想法是用一小段代码让创建 按钮上有一个图标。我看到了很多很棒的代码,但并不完全如此 我想要的。所以我决定创建自己的ciconbutton类。这 类使在按钮上设置图标变得容易。 只需在对话框中添加一个按钮。 设置按钮样式为“ownerdraw”,否则代码无法工作。 然后用类向导生成一个成员变量。 将类名从CButton更改为 确保你已经包含了“iconbutton”。h”文件 添加“iconbutton”。cpp”文件到您的项目) 在资源管理器中创建一个图标。 设置按钮的图标,设置字体,字体大小,等等 最后的版本 可以给按钮一个工具提示文本。你可以通过调用函数SetTipText ("tooltip-text"); 要了解更多细节,请查看演示项目 MethodsHide,复制Code

    void SetIconID ( const UINT nID )	
    void SetTextColor ( const COLORREF color )	
    void SetItalic ( bool bVal = true )
    void SetUnderline ( bool bVal = true )	
    void SetStrikeOut ( bool bVal = true )	
    void SetFaceName ( const CString &sVal )
    void SetWeight ( const int nVal )	
    void SetHeight ( const int nVal)
    void SetWidth ( const int nVal)	
    void SetIconSize ( const int x, const int y )	
    void SetIconRight ( bool bVal = true ) 
    void SetTipText ( const CString &sTxt )  new
    
    void Disable ( void );
    void Enable ( void );

    请注意 我认为这是最后的增强,否则“一小段代码”将会得到大量的增强;-)) 本文转载于:http://www.diyabc.com/frontweb/news459.html

  • 相关阅读:
    python的多线程
    python的socket解析
    python的os.system函数的应用
    自动化测试的4种模型
    测试中的一些常见名词解析
    mysql存储过程详解
    mysql时间加减函数
    十周课程总结
    实验&报告7
    实验& 报告7
  • 原文地址:https://www.cnblogs.com/Dincat/p/13450162.html
Copyright © 2011-2022 走看看