다음을 통해 공유


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.

Syntax

class CMFCRibbonLinkCtrl : public CMFCRibbonButton  

Members

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.

Remarks

After you create a hyperlink, add it to a panel by calling CMFCRibbonPanel::Add.

Inheritance Hierarchy

CObject CMFCRibbonBaseElement

CMFCRibbonButton CMFCRibbonLinkCtrl

Requirements

Header: afxRibbonLinkCtrl.h

CMFCRibbonLinkCtrl::CMFCRibbonLinkCtrl

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")));

CMFCRibbonLinkCtrl::CopyFrom

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

CMFCRibbonLinkCtrl::GetCompactSize

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

CMFCRibbonLinkCtrl::GetRegularSize

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

CMFCRibbonLinkCtrl::GetToolTipText

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

CMFCRibbonLinkCtrl::OnDrawMenuImage

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

CMFCRibbonLinkCtrl::IsDrawTooltipImage

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

CMFCRibbonLinkCtrl::OnDraw

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

CMFCRibbonLinkCtrl::OnMouseMove

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

CMFCRibbonLinkCtrl::OnSetIcon

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.

See Also

Hierarchy Chart
Classes
CMFCRibbonButton Class