User Tools

Site Tools


setting_20an_20edit_20box_20cue_20banner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
setting_20an_20edit_20box_20cue_20banner [2018/03/31 13:19] – external edit 127.0.0.1setting_20an_20edit_20box_20cue_20banner [2024/01/05 00:21] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 //by Richard Russell, March 2009//\\ \\  Windows Vista and later have the capability of displaying a **cue banner** in an edit control; this is a line of 'greyed out' text which can be used to prompt the user for the information he is expected to enter in that box. For example if the edit control receives a search string, the cue banner may read "Enter search text here". When the user clicks in the box, the text goes away and he can type his entry as usual.\\ \\  This facility is easily accessed using one or other of the procedures listed below. The first is for an edit control within a dialogue box, and the second is for a stand-alone edit control:\\ \\  //by Richard Russell, March 2009//\\ \\  Windows Vista and later have the capability of displaying a **cue banner** in an edit control; this is a line of 'greyed out' text which can be used to prompt the user for the information he is expected to enter in that box. For example if the edit control receives a search string, the cue banner may read "Enter search text here". When the user clicks in the box, the text goes away and he can type his entry as usual.\\ \\  This facility is easily accessed using one or other of the procedures listed below. The first is for an edit control within a dialogue box, and the second is for a stand-alone edit control:\\ \\ 
 +<code bb4w>
         DEF PROCdlgsetcuebanner(hdlg%, id%, cue$)         DEF PROCdlgsetcuebanner(hdlg%, id%, cue$)
         LOCAL wc% : DIM wc% LOCAL 2*LEN(cue$)+2 : wc% = wc% + 1 AND -2         LOCAL wc% : DIM wc% LOCAL 2*LEN(cue$)+2 : wc% = wc% + 1 AND -2
Line 15: Line 16:
         SYS "SendMessage", hedit%, EM_SETCUEBANNER, 0, wc%         SYS "SendMessage", hedit%, EM_SETCUEBANNER, 0, wc%
         ENDPROC         ENDPROC
 +</code>
 Simply call the appropriate procedure once your edit control has been created. For example to provide this facility in the DLGDEMO example program add the following code **after** the call to PROC_showdialog(), but note that other changes are also necessary (see below):\\ \\  Simply call the appropriate procedure once your edit control has been created. For example to provide this facility in the DLGDEMO example program add the following code **after** the call to PROC_showdialog(), but note that other changes are also necessary (see below):\\ \\ 
 +<code bb4w>
         PROCdlgsetcuebanner(!dlg%, 101, "Type text here")         PROCdlgsetcuebanner(!dlg%, 101, "Type text here")
 +</code>
 There are a number of conditions which must be met for a cue banner to be used:\\  There are a number of conditions which must be met for a cue banner to be used:\\ 
  
setting_20an_20edit_20box_20cue_20banner.1522502381.txt.gz · Last modified: 2024/01/05 00:16 (external edit)