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.
// Set text to display in the edit box.
m_myEdit.SetCueBanner(L"Enter your text here");