toufik 2 Posted October 1, 2022 (edited) what i'm missing ? 2022-10-01 18-19-15.mp4 Edited October 1, 2022 by toufik Share this post Link to post
Attila Kovacs 629 Posted October 1, 2022 texthint is not hint, hint is empty and edit is focused so you can't see anything Share this post Link to post
toufik 2 Posted October 1, 2022 Just now, Attila Kovacs said: texthint is not hint, hint is empty and edit is focused so you can't see anything i don't want to show a balloon hint i want to show a hint inside an edit once the user selects it , it clear Share this post Link to post
Attila Kovacs 629 Posted October 1, 2022 it works the opposite way, it's only shown if the edit is not focused 1 Share this post Link to post
toufik 2 Posted October 1, 2022 Just now, Attila Kovacs said: it works the opposite way, it's only shown if the edit is not focused yes that s what i want if you watched the video, you can see that Share this post Link to post
Attila Kovacs 629 Posted October 1, 2022 then why are you writing hint in the topic if you are such an eagle eye? otherwise no clue. debug the VCL 1 Share this post Link to post
toufik 2 Posted October 1, 2022 Just now, Attila Kovacs said: then why are you writing hint in the topic if you are such an eagle eye? otherwise no clue. debug the VCL you were right its a ''focus'' problem now i feel very stupid thank you for all your help Share this post Link to post
toufik 2 Posted October 1, 2022 the new project working fine ? 2022-10-01 21-53-22.mp4 Share this post Link to post
Attila Kovacs 629 Posted October 1, 2022 Your button texts are colorful, that means you have visual styles turned off, but it's needed to show texthint Share this post Link to post
toufik 2 Posted October 2, 2022 6 hours ago, Attila Kovacs said: Your button texts are colorful, that means you have visual styles turned off, but it's needed to show texthint can you explain more how to do that please? Share this post Link to post
Achim Kalwa 61 Posted October 5, 2022 If you want to see the TextHint even if the TEdit control has the focus, you need to send EM_SETCUEABANNER to the control: https://learn.microsoft.com/en-us/windows/win32/controls/em-setcuebanner like this: uses ... WinApi.CommCtrl, ... procedure TForm1.FormShow(Sender: TObject); begin SendTextMessage(Edit1.Handle, EM_SETCUEBANNER, WParam(True), 'please type here'); end; WParam(True): if the cue banner (text hint) should show even when the edit control has focus. Be aware that VCL controls sometimes gets recreated, resulting in a new handle value and losing previous settings. A better way would be to inherit from TEdit and overwrite the protected DoSetTextHint() method like this: Interface uses ... WinApi.CommCtrl, Vcl.Themes, ...; type TMyEdit = class(TEdit) protected procedure DoSetTextHint(const Value: string); override; end; TEdit = class(TMyEdit); ... Implementation procedure TMyEdit.DoSetTextHint(const Value: string); begin if CheckWin32Version(6, 1) // Windows 7 and up and StyleServices(Self).Enabled and HandleAllocated then SendTextMessage(Handle, EM_SETCUEBANNER, WPARAM(True), Value) else inherited; end; HTH 1 Share this post Link to post
dummzeuch 1505 Posted October 5, 2022 12 minutes ago, Achim Kalwa said: If you want to see the TextHint even if the TEdit control has the focus, you need to send EM_SETCUEABANNER to the control Also, "enable runtime themes" must be enabled in the project options (in Delphi 2007, no idea what it's called later), but that's the default. I know that because I usually disable this option so I can set colors as I want rather than having them overridden by Windows, so the cue banner didn't work in this case. 1 Share this post Link to post
toufik 2 Posted December 9, 2022 the problem was fixed by changing the rc file name ''resource file'' thank you all for help Share this post Link to post