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

Parameters

  • [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.

Return Value

true if the method is successful; otherwise false.

Remarks

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

Requirements

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.

Example

The following example demonstrates the CEdit::SetCueBanner method.

   m_cedit.SetCueBanner(_T("First, enter text here..."), TRUE);

See Also

Concepts

CEdit Class

CEdit Members

Hierarchy Chart

CEdit::GetCueBanner

EM_SETCUEBANNER

Edit_SetCueBannerTextFocused