View Issue Details

IDProjectCategoryView StatusLast Update
0035967LazarusWidgetsetpublic2020-08-16 09:11
ReporterCudaText man Assigned ToJuha Manninen  
Status resolvedResolutionwon't fix 
Product Version2.0.3 (SVN) 
Summary0035967: TMemo.TextHint don't work on Win32
Descriptionsubj. It works ok on Linux, but TextHint is always hidden on win32. Whether control focused or not focused.
TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0037553 closedJuha Manninen after rev 63725 not work memo.lines.add 


jamie philbrook

2019-08-15 20:58

reporter   ~0117692

Works here with 2.0.4 Lazarus.

CudaText man

2019-08-18 10:39

reporter   ~0117724

I tested r61720 on two PCs. win10.

Serge Anvarov

2019-08-20 22:20

reporter   ~0117755

In Win32, the TextHint property has built-in support, but not for multiline edit (TMemo):

jamie philbrook

2019-08-20 23:50

reporter   ~0117757

@Serge Anvarov
   Those are CUE BANNERS, they are not the same as HintText. Although they kind of work the same way in general.

   He asked for Hint TExt, it works on my end, he claims it does not for a memo

   I also just tested it on my old W2K using Delphi, it works there, too.

 So maybe he should clarify his statement a little more.

CudaText man

2019-08-22 09:34

reporter   ~0117781

I wrote about TextHint property

Bart Broersma

2019-08-22 20:18

developer   ~0117785

I'm not sure wether this is by design or not.
On Windows TextHint is set by the WS, which AFAIK does not support that for a memo?

Dmitry Boyarintsev

2019-08-22 20:59

developer   ~0117786

Last edited: 2019-08-22 20:59

View 2 revisions

@jamie philbrook
do you have a screen shot of working TextHint for TMemo on Windows?

as Serge Anvarov states the TextHint is not supported for TMemo by WinAPI.

jamie philbrook

2019-08-22 22:26

reporter   ~0117787

The issue here is it's improperly named, it should of been named "CueBanner" which is what it is..

  I was using the published Hint and of course that works. But this TextHint isn't published in Tmemo, at least its not on my system and most likely for good reason.
 Texthint (CueBanner) Works only in non-multiline Edit controls and if you use a TEDIT the property is published and it does work.

 I don't know what to tell you, ether don't worry about it and wait for windows to support it or emulate it ?

Serge Anvarov

2019-08-23 14:16

reporter   ~0117798

I don't see a good solution other than {$IFDEF WINDOWS} to use withing some methods.

In your program you can do so:
//...uses ..., LCLType,...
  TMemo = class(StdCtrls.TMemo)
    function CanShowEmulatedTextHint: Boolean; override;
    procedure InitializeWnd; override;
    procedure SetTextHint(const AValue: TTranslateString); override;

  TForm1 = class(TForm)
uses Win32Proc;
function TMemo.CanShowEmulatedTextHint: Boolean;
  SaveComCtlVersion: Cardinal;
  SaveComCtlVersion := ComCtlVersion;
  ComCtlVersion := 0;
    Result := inherited;
    ComCtlVersion := SaveComCtlVersion;
And in the same way to write all three methods.
Reset variable ComCtlVersion force LCL to believe that the system doesn't support property TextHint and will be used an emulation.

Juha Manninen

2020-08-13 14:11

developer   ~0124843

Last edited: 2020-08-13 16:12

View 3 revisions

I first wrote Serge Anvarov's comment makes no sense, but it does.

function TWin32WidgetSet.GetLCLCapability tests for ComCtlVersion :
      if (ComCtlVersion >= ComCtlVersionIE6) then
        Result := LCL_CAPABILITY_YES
        Result := LCL_CAPABILITY_NO;

and function TCustomEdit.CanShowEmulatedTextHint calls GetLCLCapability.

Juha Manninen

2020-08-16 09:07

developer   ~0124918

Last edited: 2020-08-16 09:11

View 3 revisions

I resolve this as "won't fix".
Only native TextHint works for TMemo. The emulated version is tricky. LCL binding code for TMemo has 2 internal TStrings, one of them in widgetset code. Adding notifications for them requires studying and refactoring the code.

Emulated TextHint is now disabled for TMemo. See function TCustomMemo.CanShowEmulatedTextHint.
It did not work when lines were added to a Memo by code. See the related 0037553 for details.
It means Serge Anvarov's changes have no effect now.

If somebody does the required refactoring and testing, please reopen and provide a patch.

Issue History

Date Modified Username Field Change
2019-08-15 19:44 CudaText man New Issue
2019-08-15 20:58 jamie philbrook Note Added: 0117692
2019-08-18 10:39 CudaText man Note Added: 0117724
2019-08-20 22:20 Serge Anvarov Note Added: 0117755
2019-08-20 23:50 jamie philbrook Note Added: 0117757
2019-08-22 09:34 CudaText man Note Added: 0117781
2019-08-22 20:18 Bart Broersma Status new => confirmed
2019-08-22 20:18 Bart Broersma LazTarget => -
2019-08-22 20:18 Bart Broersma Note Added: 0117785
2019-08-22 20:59 Dmitry Boyarintsev Note Added: 0117786
2019-08-22 20:59 Dmitry Boyarintsev Note Edited: 0117786 View Revisions
2019-08-22 22:26 jamie philbrook Note Added: 0117787
2019-08-23 14:16 Serge Anvarov Note Added: 0117798
2020-08-12 08:32 Juha Manninen Relationship added related to 0037553
2020-08-13 14:11 Juha Manninen Note Added: 0124843
2020-08-13 14:12 Juha Manninen Note Edited: 0124843 View Revisions
2020-08-13 16:12 Juha Manninen Note Edited: 0124843 View Revisions
2020-08-16 09:07 Juha Manninen Assigned To => Juha Manninen
2020-08-16 09:07 Juha Manninen Status confirmed => resolved
2020-08-16 09:07 Juha Manninen Resolution open => won't fix
2020-08-16 09:07 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-08-16 09:07 Juha Manninen Note Added: 0124918
2020-08-16 09:09 Juha Manninen Note Edited: 0124918 View Revisions
2020-08-16 09:11 Juha Manninen Note Edited: 0124918 View Revisions