Udostępnij za pośrednictwem


CMFCToolTipInfo 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 CMFCToolTipInfo Class.

Stores information about the visual appearance of tooltips.

Syntax

class CMFCToolTipInfo  

Members

Public Methods

Name Description
CMFCToolTipInfo::operator=

Data Members

Name Description
CMFCToolTipInfo::m_bBalloonTooltip A Boolean variable that indicates whether the tooltip has a balloon appearance.
CMFCToolTipInfo::m_bBoldLabel A Boolean variable that indicates whether tooltip labels are displayed in a bold font.
CMFCToolTipInfo::m_bDrawDescription A Boolean variable that indicates whether the tooltip contains a description.
CMFCToolTipInfo::m_bDrawIcon A Boolean variable that indicates whether the tooltip contains an icon.
CMFCToolTipInfo::m_bDrawSeparator A Boolean variable that indicates whether a separator is displayed between the tooltip label and the tooltip description.
CMFCToolTipInfo::m_bRoundedCorners A Boolean variable that indicates whether the tooltip has rounded corners.
CMFCToolTipInfo::m_bVislManagerTheme A Boolean variable that indicates whether the appearance of the tooltip should be controlled by a visual manager (see CMFCVisualManager Class).
CMFCToolTipInfo::m_clrBorder The color of the tooltip border.
CMFCToolTipInfo::m_clrFill The color of the tooltip background.
CMFCToolTipInfo::m_clrFillGradient The color of the gradient fill in the tooltip.
CMFCToolTipInfo::m_clrText The text color in the tooltip.
CMFCToolTipInfo::m_nGradientAngle The angle of the gradient fill in the tooltip.
CMFCToolTipInfo::m_nMaxDescrWidth The maximum possible width, in pixels, of the description in the tooltip.

Remarks

Use CMFCToolTipCtrl Class, CMFCToolTipInfo, and CTooltipManager Class together to implement customized tooltips in your application. For an example of how to use these tooltip classes, see the CMFCToolTipCtrl Class topic.

Example

The following example demonstrates how to set the values of the various member variables in the CMFCToolTipInfo class.

   CMFCToolTipInfo* params = new CMFCToolTipInfo();
    
    params->m_bBoldLabel = FALSE;
    params->m_bDrawDescription = FALSE;
    params->m_bDrawIcon = FALSE;
    params->m_bRoundedCorners = TRUE;
    params->m_bDrawSeparator = FALSE;
    params->m_clrFill = RGB (255, 255, 255);
    params->m_clrFillGradient = RGB (228, 228, 240);
    params->m_clrText = RGB (61, 83, 80);
    params->m_clrBorder = RGB (144, 149, 168);

Inheritance Hierarchy

CMFCToolTipInfo

Requirements

Header: afxtooltipctrl.h

CMFCToolTipInfo::m_bBalloonTooltip

Specifies the display style of all tooltips.

BOOL m_bBalloonTooltip;  

Remarks

TRUE indicates that tooltips use the balloon style, FALSE indicates that tooltips use the rectangular style.

CMFCToolTipInfo::m_bBoldLabel

Specifies whether the font of the tooltip text is bold.

BOOL m_bBoldLabel;  

Remarks

Set this member to TRUE to display tooltip text with bold font, or FALSE to display tooltip labels with non-bold font.

CMFCToolTipInfo::m_bDrawDescription

Specifies whether each tooltip displays description text.

BOOL m_bDrawDescription;  

Remarks

Set this member to TRUE to display the description, or FALSE to hide the description. You can specify the description on a tooltip by calling CMFCToolTipCtrl::SetDescription

CMFCToolTipInfo::m_bDrawIcon

Specifies whether all tooltips display icons.

BOOL m_bDrawIcon;  

Remarks

Set this member to TRUE to display an icon on each tooltip, or FALSE to display tooltips without icons.

CMFCToolTipInfo::m_bDrawSeparator

Specifies whether each tooltip has a separator between its label and its description.

BOOL m_bDrawSeparator;  

Remarks

Set this member to TRUE to display separator between tooltip label and description, or FALSE to display tooltips with no separator.

CMFCToolTipInfo::m_bRoundedCorners

Specifies whether all tooltips have rounded corners.

BOOL m_bRoundedCorners;  

Remarks

Set this member to TRUE to display rounded corners on tooltips, or FALSE to display rectangular corners on tooltips.

CMFCToolTipInfo::m_clrBorder

Specifies the color of the borders on all tooltips.

COLORREF m_clrBorder;  

CMFCToolTipInfo::m_clrFill

Specifies the color of tooltip backgrounds.

COLORREF m_clrFill;  

Remarks

If CMFCToolTipInfo::m_clrFillGradient is -1, the tooltip background color is m_clrFill. Otherwise, m_clrFill specifies the color of the beginning of the gradient and m_clrFillGradient specifies the color of the end of the gradient. CMFCToolTipInfo::m_nGradientAngle determines the direction of the gradient.

CMFCToolTipInfo::m_clrFillGradient

Specifies the end color for a gradient background for tooltips.

COLORREF m_clrFillGradient;  

Remarks

If m_clrFillGradient is -1, there is no gradient. Otherwise, the gradient initial color is specified by CMFCToolTipInfo::m_clrFill and the gradient finish color is specified by m_clrFillGradient. CMFCToolTipInfo::m_nGradientAngle determines the direction of the gradient.

CMFCToolTipInfo::m_clrText

Specifies text color of all tooltips.

COLORREF m_clrText;  

CMFCToolTipInfo::m_nGradientAngle

Specifies the angle at which a gradient is drawn on the background of tooltips.

int m_nGradientAngle;  

Remarks

m_nGradientAngle specifies the angle, in degrees, that the gradient on the background of tooltips is offset from horizontal. If m_nGradientAngle is 0, the gradient is drawn from left to right. If m_nGradientAngle is between 1 and 360, the gradient is rotating clockwise by that number of degrees. If m_nGradientAngle is -1, which is the default value, the gradient is drawn from top to bottom. This is the same as setting m_nGradientAngle to 90.

CMFCToolTipInfo::m_clrFill clrFill specifies the color of the beginning of the gradient and CMFCToolTipInfo::m_clrFillGradient clrFillGradient specifies the color of the end of the gradient. If m_clrFillGradient is -1, there is no gradient.

CMFCToolTipInfo::m_nMaxDescrWidth

Specifies the maximum width of the description that it displayed in each tooltip. If the description width exceeds the specified value, the text is wrapped.

int m_nMaxDescrWidth;  

CMFCToolTipInfo::m_bVislManagerTheme

Specifies whether the visual manager of the application controls the appearance of all tooltips.

BOOL m_bVislManagerTheme;  

Remarks

If m_bVislManagerTheme is TRUE, every tooltip requests a new CMFCToolTipInfo from the visual manager of the application before they appear on the screen, and uses the values in that object to determine their appearance. The other members of your CMFCToolTipInfo are ignored.

CMFCToolTipInfo::operator=

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.

CMFCToolTipInfo& operator=(CMFCToolTipInfo& src);

Parameters

[in] src

Return Value

Remarks

See Also

Hierarchy Chart
Classes
CTooltipManager Class
CMFCToolTipCtrl Class