CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    How can set Hand Cursor on Hyperlink?

    Hi all,

    i have static text for mailto and website.and it is working as hyperlink perfectly.

    only one problem is there the hand cursor not display when i move mouse on this.

    please help me for this.

    thanks in advance.
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How can set Hand Cursor on Hyperlink?

    Could this article help you?
    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2008
    Posts
    37

    Re: How can set Hand Cursor on Hyperlink?

    if you are using MS VS C++ on Form, linklabel will benefit. Change the cursor easy and U can add in other curosr also. it offers many event handlings, you don't need to rewrite like you do in previous MfC

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: How can set Hand Cursor on Hyperlink?

    Which version of VC/MFC are you using? Since VS2003, MFC has supported (though barely documented) the SysLink control. In VS2008, it is part of the resource toolbox and can be dragged and dropped onto the dialog just like any other control. In VS2005 and earlier, you need to "remind" the compiler that it is there. Drop a custom control on your dialog; in properties, change the "Class" to "SysLink" and change the "ID" to "IDC_SYSLINK1". After that, the right-click menu will show up and things like "Add Event Handler" will become active. To make a valid link, add something like this to the "Caption" in properties:

    Code:
      <A HREF="http://www.google.com">www.google.com</A>
    Use "Add Event Handler" to add code for your NM_CLICK event, but again, VS2005 and prior don't implement this quite correctly and omit the normal step of recasting the notification header for you, so add the line:

    Code:
      PNMLINK pNMLink = (PNMLINK) pNMHDR;
    to take full advantage of the notification message.

    A typical example of this for an about box would look like this:

    Code:
    void CAboutDlg::OnNMClickSyslink1(NMHDR *pNMHDR, LRESULT *pResult)
    {
      PNMLINK pNMLink = (PNMLINK) pNMHDR;   
    
      if(pNMLink->item.szUrl[0]){
        ShellExecute(m_hWnd,NULL,pNMLink->item.szUrl,NULL,NULL,1);
      }
      *pResult = 0;
    }
    The SysLink control also supports "ID" tags for linking to other executables. See help on "Syslink COntrol Reference" for mode documentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured