Topic: problem with texthint

Hi Dmitry,

I am trying to add a script to use the .texthint function as  -   Form1.Edit1.TextHint := 'Enter First Name';
But no text hint is displayed in form1.edit1.
Any ideas what I am doing wrong?
Example is attached.
I am using 1.51.
Thanks,
Derek.

Post's attachments

Attachment icon texthint.zip 334.56 kb, 504 downloads since 2015-05-26 

Re: problem with texthint

Hello,


Tested, works.
Text hint is displayed, when component Edit don't have focus.

Dmitry.

Re: problem with texthint

Hi Dmitry,

I still have the problem so i have tried to make a better example for you.
On Form1, i click ADD to open Form2.
When Form2 opens, Edit3 has focus, therefore the texthints for Edit1 and Edit2 should display, if i understand your reply correctly.
But as you can see in the attached screenshot ('dmitry texthint.jpg), no texthints are displayed.
Is there something else that i need to do?
For information, i am running MVD 1.51 on Windows XP SP3.
Thanks,
Derek.

Post's attachments

Attachment icon texthint.zip 424.38 kb, 502 downloads since 2015-05-26 

Re: problem with texthint

Hello Derek

Otherwise, you have the solution of an old Delphi developper :

With Event Form2.OnShow :

Begin
   Form2.Edit1.ShowHint := True;
   Form2.Edit2.ShowHint := True;
   Form2.Edit1.Hint := 'Enter First Name';
   Form2.Edit2.Hint := 'Enter Last Name';
End;

You can also put this piece of code between final Begin ... End.

And to do all more beautiful, you can add

  Form2.Edit1.Cursor := crHandPoint;
  Form2.Edit1.Cursor := crHandPoint;

JB

Re: problem with texthint

derek
I suppose that this feature don't work in Windows XP, only for Windows 7 and above.

Dmitry.

Re: problem with texthint

Hello Dmitry

It works fine with MVD 1.50_v4
I'm under Windows 8.1

JB

Re: problem with texthint

Hi Dmitry, Hi Jean,
As you say, maybe it is because of Windows XP although it surprises me.  I hope there are not other areas where some features only work with certain versions of Windows - that has implications for installing projects you have written on different PCs.
I have used ('showhint' and 'hint') before but i think 'texthint' looks better.  But it is not a major problem if i can't use 'texthint', it just would have been nice.

By the way, i have always used 'Form1.showhint := true;  rather than write it for each Edit field - i suppose it's slightly quicker if you have lots to do. 
Actually, i don't know why 'hints' (and 'texthints') can't be one of the properties for Edit fields (and Combobox, Memo and DateTimePicker fields) - it would be much easier,  it would encourage people to use the 'hints' features (not many appear to use it) and you could then take it out of the scripts.
I have also just tried 'crhandpoint' and that is a nice touch!  I will certainly use that.
Thankyou Both for the quick replies.
Derek.

Re: problem with texthint

Hello Derek and Dmitry

It's true that Dmitry's Texthint is shorter than my way.
Texthint is also more modern. We can often see this kind of hint (applications, web, games).
But the goal is to obtain what we want to do with this function.

Cordialy

JB