| title | CMFCRibbonLinkCtrl Class | Microsoft Docs | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||||
| ms.reviewer | ||||||||||||||||
| ms.suite | ||||||||||||||||
| ms.technology |
|
|||||||||||||||
| ms.tgt_pltfrm | ||||||||||||||||
| ms.topic | reference | |||||||||||||||
| f1_keywords |
|
|||||||||||||||
| dev_langs |
|
|||||||||||||||
| helpviewer_keywords |
|
|||||||||||||||
| ms.assetid | 77ae1941-e0ab-4a9d-911e-1752d34c079b | |||||||||||||||
| caps.latest.revision | 22 | |||||||||||||||
| author | mikeblome | |||||||||||||||
| ms.author | mblome | |||||||||||||||
| manager | ghogen | |||||||||||||||
| translation.priority.ht |
|
Implements a hyperlink that is positioned on a ribbon. The hyperlink opens a Web page when you click it.
[!INCLUDEcpp_fp_under_construction]
class CMFCRibbonLinkCtrl : public CMFCRibbonButton
| Name | Description |
|---|---|
| CMFCRibbonLinkCtrl::CMFCRibbonLinkCtrl | Constructs and initializes a CMFCRibbonLinkCtrl object. |
| Name | Description |
|---|---|
| CMFCRibbonLinkCtrl::CopyFrom | (Overrides CMFCRibbonButton::CopyFrom.) |
| CMFCRibbonLinkCtrl::GetCompactSize | (Overrides CMFCRibbonButton::GetCompactSize.) |
| CMFCRibbonLinkCtrl::GetLink | Returns the value of the hyperlink. |
| CMFCRibbonLinkCtrl::GetRegularSize | (Overrides CMFCRibbonButton::GetRegularSize.) |
| CMFCRibbonLinkCtrl::GetToolTipText | (Overrides CMFCRibbonButton::GetToolTipText.) |
| CMFCRibbonLinkCtrl::IsDrawTooltipImage | (Overrides CMFCRibbonButton::IsDrawTooltipImage.) |
| CMFCRibbonLinkCtrl::OnDraw | (Overrides CMFCRibbonButton::OnDraw.) |
| CMFCRibbonLinkCtrl::OnDrawMenuImage | (Overrides CMFCRibbonBaseElement::OnDrawMenuImage.) |
| CMFCRibbonLinkCtrl::OnMouseMove | (Overrides CMFCRibbonButton::OnMouseMove.) |
| CMFCRibbonLinkCtrl::OnSetIcon | |
| CMFCRibbonLinkCtrl::OpenLink | Opens the Web page specified in the hyperlink. |
| CMFCRibbonLinkCtrl::SetLink | Sets the value of the hyperlink. |
After you create a hyperlink, add it to a panel by calling CMFCRibbonPanel::Add.
CMFCRibbonButton CMFCRibbonLinkCtrl
Header: afxRibbonLinkCtrl.h
Constructs and initializes a CMFCRibbonLinkCtrl object.
CMFCRibbonLinkCtrl(
UINT nID,
LPCTSTR lpszText,
LPCTSTR lpszLink);
[in] nID
Specifies the command ID of the command that executes when the link control is clicked.
[in] lpszText
Specifies the label to display on the link control.
[in] lpszLink
Specifies the hyperlink associated with the link control.
The following example demonstrates how to use the constructor of the CMFCRibbonLinkCtrl class. This code snippet is part of the Ribbon Gadgets sample.
[!code-cppNVC_MFC_RibbonGadgets#1]
virtual void CopyFrom(const CMFCRibbonBaseElement& src);
[in] src
virtual CSize GetCompactSize(CDC* pDC);
[in] pDC
Returns the value of the hyperlink.
LPCTSTR GetLink() const;
The current value of the hyperlink.
virtual CSize GetRegularSize(CDC* pDC);
[in] pDC
virtual CString GetToolTipText() const;
virtual BOOL OnDrawMenuImage(CDC*, CRect);
[in] CDC*
[in] CRect
virtual BOOL IsDrawTooltipImage() const;
virtual void OnDraw(CDC* pDC);
[in] pDC
virtual void OnMouseMove(CPoint point);
[in] point
virtual void OnSetIcon();
Opens the Web page specified in the hyperlink.
BOOL OpenLink();
TRUE if the associated Web page was opened successfully; otherwise, FALSE.
Opens a web page using the hyperlink associated with the CMFCRibbonLinkCtrl object.
Sets the value of the hyperlink.
void SetLink(LPCTSTR lpszLink);
[in] lpszLink
Specifies the hyperlink text.