Function Reference


_GUICtrlEdit_SetCueBanner

Sets the cue banner text that is displayed for the edit control

#include <GuiEdit.au3>
_GUICtrlEdit_SetCueBanner ( $hWnd, $sText [, $bOnFocus = False] )

Parameters

$hWnd Control ID/Handle to the control
$sText String that contains the text
$bOnFocus [optional] True - if the cue banner should show even when the edit control has focus.
False (Default) - the cue banner disappears when the user clicks in the control.

Return Value

Success: True.
Failure: False.

Remarks

The cue banner is text that is displayed in the edit control when there is no selection.
A cue banner will only display in Input and single-line Edit controls - not multi-line Edit or RichText controls.

Windows Vista or later.

Related

_GUICtrlEdit_GetCueBanner

Example

#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
        Local $hGUI = GUICreate('Example', 300, 150)
        GUISetFont(9, 400, 0, 'Segoe UI')

        Local $idUsername = GUICtrlCreateInput('', 10, 10, 125, 25)
        _GUICtrlEdit_SetCueBanner($idUsername, "Search folder")

        Local $idPassword = GUICtrlCreateInput('', 10, 40, 125, 25)
        _GUICtrlEdit_SetCueBanner($idPassword, "Search...")

        Local $idButton_Close = GUICtrlCreateButton("Close", 210, 120, 85, 25)
        ControlFocus($hGUI, "", $idButton_Close)

        GUISetState(@SW_SHOW, $hGUI)

        MsgBox($MB_SYSTEMMODAL, "", _GUICtrlEdit_GetCueBanner($idPassword))

        While 1
                Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE, $idButton_Close
                                ExitLoop

                EndSwitch
        WEnd

        GUIDelete($hGUI)
EndFunc   ;==>Example