views:

272

answers:

2

Hi All,

Is there an easy way in MFC to add a hyperlink in a button? I've searched the net and they seem to offer complicated stuff.

Thanks.

A: 

MFC doesn't implement buttons with hyperlinks (actually win32 common buttons don't support it).

You'll have to use 3rd party buttons.
One option is to use the FooButton class which supports hyperlinks.

Nick D
+4  A: 

This video shows how to use the SysLink common control (CLinkCtrl). Beware that MFC support for this control is new and requires VS2008 and the Feature Pack.

Bear in mind that the SysLink control is XP+. If you have to support older platforms, or if you use an older VS, your best bet is probably the good old CStaticLink by Paul DiLascia (RIP).

Serge - appTranslator
Wow! I didn't know such a thing exists. Is there any way we could remove the underline in the link?
Owen
I don't think so but I don't have in depth knowledge of this control. I would be surprised since the purpose is to mimic basic HTML links so that users understand they can click the text.
Serge - appTranslator