Export (0) Print
Expand All

CEdit::SetCueBanner

Sets the text that is displayed as the text cue, or tip, in an edit control when the control is empty.

BOOL SetCueBanner(
     LPCWSTR lpszText
);
BOOL SetCueBanner(
     LPCWSTR lpszText, 
     BOOL fDrawWhenFocused = FALSE
);

[in] lpszText

Pointer to a string that contains the cue to display in the edit control.

[in] fDrawWhenFocused

If false, the cue banner is not drawn when the user clicks in the edit control and gives the control the focus.

If true, the cue banner is drawn even when the control has focus. The cue banner disappears when the user starts to type in the control.

The default value is false.

true if the method is successful; otherwise false.

This method sends the EM_SETCUEBANNER message, which is described in the Windows SDK. For more information, see the Edit_SetCueBannerTextFocused macro.

Header: afxwin.h

This control is supported in Windows XP and later.

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

The following example demonstrates the CEdit::SetCueBanner method.

	m_cedit.SetCueBanner(_T("First, enter text here..."), TRUE);
Show:
© 2014 Microsoft