CueText equivalent for a TMemo

Posted by JosephStyons on Stack Overflow See other posts from Stack Overflow or by JosephStyons
Published on 2009-09-23T13:01:38Z Indexed on 2010/04/09 1:23 UTC
Read the original article Hit count: 330

Filed under:
|

I have this Delphi code to set the cue text of a control on my form:

procedure TfrmMain.SetCueText(edt: TWinControl; cueText: string);
const
  ECM_FIRST = $1500;
  EM_SETCUEBANNER = ECM_FIRST + 1;
begin
  SendMessage(edt.Handle,EM_SETCUEBANNER,0,
    LParam(PWideChar(WideString(cueText))));
end;

I want the same effect on a TMemo, but the MSDN document says:

You cannot set a cue banner on a multiline edit control or on a rich edit control.

Is there a standard way to have a cuetext effect on a TMemo, or do I have to fiddle with the OnEnter/OnExit events and roll my own?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about cuetext