1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

url on a text in mfc dlg

Discussion in 'MFC' started by fenomeno83, Apr 14, 2006.

  1. fenomeno83

    fenomeno83 New Member

    Joined:
    Apr 14, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    how can I assiciate a link(URL) to a static text with mfc dialog based?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    This cannot be done directly. All you need to do is Derive a class from the CStatic and then change the font of the control to look like hyperlink and overwrite the Click event to open the default browser and display the URL.

    Thanks
    Shabbir
     
  3. fenomeno83

    fenomeno83 New Member

    Joined:
    Apr 14, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    can I have an example code?thanks
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    I have created a sample of how to [thread=741]Make CStatic into a Hyperlink.[/thread]
     
  5. fenomeno83

    fenomeno83 New Member

    Joined:
    Apr 14, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    thank you very much!!!!!
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    My pleasure.
     

Share This Page