CListCtrl with Web Links

Source: Internet
Author: User

source code and executable file: Http://files.cnblogs.com/rainboy2010/ListCtrlLinkTest.zip

Clistctrllink is an extension class for CListCtrl that can contain Web links in Listctrl controls

How to use:

1. Add ListCtrlLink.h,ListCtrlLink.cpp,LinkItem.h,LinkItem.cpp files to your project project

2. Add the Listctrl control and associate it with the corresponding Clistctrllink variable

Clistctrllink    M_listctrl;

3. Add the following code in OnInitDialog ():

M_listctrl.insertcolumn (0, _t ("Name"), Lvcfmt_left, -); M_listctrl.insertcolumn (1, _t (" Age"), Lvcfmt_left, -); M_listctrl.insertcolumn (2, _t (" Company"), Lvcfmt_left, -); M_listctrl.insertcolumn (3, _t ("Email"), Lvcfmt_left, $); M_listctrl.insertitem (0, _t ("Ana")); M_listctrl.setitemtext (0,1, _t (" -")); M_listctrl.setitemtext (0,2, _t ("Stanford"), _t ("http://www.stanford.edu")); M_listctrl.setitemtext (0,3, _t ("Unpublished"));
M_listctrl.insertitem (1, _t ("John")); M_listctrl.setitemtext (1,1, _t (" +")); M_listctrl.setitemtext (1,2, _t ("Yahoo"), _t ("http://www.yahoo.com")); M_listctrl.setitemtext (1,3, _t ("[email protected]"), _t ("Mailto:[email protected]")); M_listctrl.insertitem (2, _t ("Cassio")); M_listctrl.setitemtext (2,1, _t (" in")); M_listctrl.setitemtext (2,2, _t ("Symantec"), _t ("http://www.symantec.com")); M_listctrl.setitemtext (2,3, _t ("[Email protected]_email.org"), _t ("Mailto:[email protected]_email.org")); M_listctrl.insertitem (3, _t ("Peter")); M_listctrl.setitemtext (3,1, _t (" -")); M_listctrl.setitemtext (3,2, _t ("retired")); M_listctrl.setitemtext (3,3, _t ("[Email protected]_man.org"), _t ("Mailto:[email protected]_man.org"));

The prototype for Setitemtext is: BOOL setitemtext (int nitem, int nsubitem, LPCTSTR lpszText, lpctstr lpctszurl = NULL),

If Lpctszurl does not set a value, the hyperlink is not displayed, such as setting the value, the corresponding column is displayed as a hyperlink, and clicking on the hyperlink will execute the ShellExecute API call

CListCtrl with Web Links

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.