To answer your first question TField.FocusControl will focus the first
editor linked to the field. 

 

With the edit box you can probably use something like SelStart to do what
you are wanting (the details depend a bit on the edit control though I think
and I haven't used the standard VCL ones in years)

 

Cheers,

David.

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of Marshland Engineering
Sent: Monday, 6 June 2011 3:12 p.m.
To: delphi@delphi.org.nz
Subject: [DUG] RE Data validation.

 

After a bit of experimenting, it seems that the OnValidate is triggered once
you leave the dbEdit box and it is before the Post is committed. This means
that you get a message directly after the box you have just entered the data
into. 

 

This words great for data validation across many forms, but, it tells you
the error, however it does not does not return you the box you have just
left. Is there a way to put the cursor back to the dbEdit box if an error is
encountered ?

 

Along a similar line, is there a way to find where the cursor is within a
string in and edit box ?

 

Thanks Wallace

 

 

 

 

 

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to