CMFCRibbonLinkCtrl Class
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at CMFCRibbonLinkCtrl Class.
Implements a hyperlink that is positioned on a ribbon. The hyperlink opens a Web page when you click it.
class CMFCRibbonLinkCtrl : public CMFCRibbonButton
Public Constructors
| Name | Description |
|---|---|
| CMFCRibbonLinkCtrl::CMFCRibbonLinkCtrl | Constructs and initializes a CMFCRibbonLinkCtrl object. |
Public Methods
| 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);
Parameters
[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.
Example
The following example demonstrates how to use the constructor of the CMFCRibbonLinkCtrl class. This code snippet is part of the Ribbon Gadgets sample.
// CMFCRibbonPanel* pPanel3 pPanel3->Add(new CMFCRibbonLinkCtrl(ID_RIBBON_OBTN_2, _T("Send e-mail"), _T("mailto:info@microsoft.com")));
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void CopyFrom(const CMFCRibbonBaseElement& src);
Parameters
[in] src
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual CSize GetCompactSize(CDC* pDC);
Parameters
[in] pDC
Return Value
Remarks
Returns the value of the hyperlink.
LPCTSTR GetLink() const;
Return Value
The current value of the hyperlink.
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual CSize GetRegularSize(CDC* pDC);
Parameters
[in] pDC
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual CString GetToolTipText() const;
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL OnDrawMenuImage(CDC*, CRect);
Parameters
[in] CDC*
[in] CRect
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL IsDrawTooltipImage() const;
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnDraw(CDC* pDC);
Parameters
[in] pDC
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnMouseMove(CPoint point);
Parameters
[in] point
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnSetIcon();
Remarks
Opens the Web page specified in the hyperlink.
BOOL OpenLink();
Return Value
TRUE if the associated Web page was opened successfully; otherwise, FALSE.
Remarks
Opens a web page using the hyperlink associated with the CMFCRibbonLinkCtrl object.
Sets the value of the hyperlink.
void SetLink(LPCTSTR lpszLink);
Parameters
[in] lpszLink
Specifies the hyperlink text.