您的位置:首页 > 其它

在Windows Mobile和Wince(Windows Embedded CE)下进行WTL开发,如何加入超链接(HyperLink)

2009-11-12 08:36 656 查看
本文讲述在Windows Mobile和Wince(Windows Embedded CE)下进行WTL开发,如何加入超链接(HyperLink)的支持。

步骤如下:

1.#include <atlctrlx.h>

#include <atlctrlx.h>


2.在对话框中加入一个Static控件。





3.修改Static控件的ID。





4.进行DDX绑定。





注意Member type需要手工输入 CHyperLink

DDX type必须使用Control,不能使用Control Handler。否则编译时会出现下面错误。

Error 1 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'ATL::CWindow' (or there is no acceptable conversion)



5.加入处理代码

m_wndWebsite.SetHyperLinkExtendedStyle ( HLINK_USETAGS ); //Set style
m_wndWebsite.SetLabel(_T("visit <a>www.cnblogs.com/procoder</a>")); //Set display label
m_wndWebsite.SetHyperLink(_T("http://www.cnblogs.com/procoder/"));  //Set hyper link




完成了,显示效果如下:





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐