Condividi tramite


CLinkCtrl::GetIdealSize

Calculates the preferred height of the link text for the current link control, depending on the specified width of the link.

int GetIdealSize(
    int cxMaxWidth, 
    SIZE* pSize
) const;

Parameters

Parameter

Description

[in] cxMaxWidth

The maximum width of the link, in pixels.

[out] *pSize

A pointer to a Windows SIZE structure. When this method returns, the cy member of the SIZE structure contains the ideal link text height for the link text width that is specified by cxMaxWidth. The cx member of the structure contains the link text width that is actually needed.

Return Value

The preferred height of the link text, in pixels. The return value is the same as the value of the cy member of the SIZE structure.

Remarks

For an example of the GetIdealSize method, see the example in CLinkCtrl::Create.

This method sends the LM_GETIDEALSIZE message, which is described in the Windows SDK.

Requirements

Header: afxcmn.h

This method is supported in Windows Vista and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

See Also

Reference

CLinkCtrl Class

Hierarchy Chart

LM_GETIDEALSIZE

SIZE

CLinkCtrl::GetIdealHeight

Other Resources

CLinkCtrl Members