EM_SETCUEBANNER message
Applies to: desktop apps only
Sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information.
Parameters
- wParam [in]
-
TRUE if the cue banner should show even when the edit control has focus; otherwise, FALSE. FALSE is the default behavior—the cue banner disappears when the user clicks in the control.
- lParam [in]
-
A pointer to a Unicode string that contains the text to display as the textual cue.
Return value
If the message succeeds, it returns TRUE. Otherwise it returns FALSE.
Remarks
An edit control that is used to begin a search may display "Enter search here" in gray text as a textual cue. When the user clicks the text, the text goes away and the user can type.
You cannot set a cue banner on a multiline edit control or on a rich edit control.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
See also
Send comments about this topic to Microsoft
Build date: 3/6/2012
This issue is fixed on Vista.
- 3/23/2009
- David Lowndes
- 4/13/2009
- Stanley Roark
// Alexander Klimov
// http://developer.alexanderklimov.ru/
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SendMessage(IntPtr hWnd, int msg,
int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
private const int EM_SETCUEBANNER = 0x1501;
SendMessage(textBox1.Handle, EM_SETCUEBANNER, 0, "Type your question");
- 12/7/2008
- tehnolog
- 4/13/2009
- Stanley Roark
wParam TRUE - only appears to work on Vista.
Under XP the cue text always disappears when the control gets focus regardless of this parameter.
- 12/11/2007
- David Lowndes
- 4/13/2009
- Stanley Roark
- 1/27/2009
- Stanley Roark