现在的位置: 首页 > 综合 > 正文

静态文本超链接编程暨CStaticLink类使用说明

2013年01月31日 ⁄ 综合 ⁄ 共 766字 ⁄ 字号 评论关闭

      静态文本超链接编程暨CStaticLink类使用说明

********************************************************

例子:在About对话框上实现如下图蓝色显示的两个静态文本超链接。

编程步骤如下:

1、  向工程项目中添加StatLink.cppStatLink.h文件。

2、  About对话框类中包含头文件#include "StatLink.h" ,并声明两个CStaticLink对象

   protected:

       CStaticLink     m_wndLink1;

       CStaticLink     m_wndLink2;

3、重载OnInitDialog()函数

  BOOL CAboutDlg::OnInitDialog()

{

       CDialog::OnInitDialog();

       // TODO: Add extra initialization here

       m_wndLink1.m_link = _T("http://www.hdu.edu.cn");

       m_wndLink2.m_link = _T("mailto:xuexiuyin@163.com");

       m_wndLink1.SubclassDlgItem(IDC_STATIC_APARTMENT, this);

       m_wndLink2.SubclassDlgItem(IDC_STATIC_MAIL, this);

       return TRUE;  // return TRUE unless you set the focus to a control

                     // EXCEPTION: OCX Property Pages should return FALSE

}

 

抱歉!评论已关闭.