Subject | Re: [IBO] FocusControl? |
---|---|
Author | Helen Borrie |
Post date | 2004-06-29T22:47:34Z |
At 05:31 PM 29/06/2004 +0200, you wrote:
Try doing it this way:
TmpFld.FocusControl;
*before* raising the exception.
Helen
>hello Helen,[..]
>
> > What do you want to do? The TIB_Dataset already calls
> > this method itself during the CheckRequiredFields period
> > of BeforePost.
>
>yes, of course, but in the on before post event of the query I'm doing some
>extra checks on some fields, and if something is wrong I'd like to focus
>the associated control:
Try doing it this way:
> if Something wrong thenbegin
TmpFld.FocusControl;
> raise EBadValueError.Create('The value is bad')end
> end;It seems to make more sense to follow Jason's usage and call FocusControl
> .....
> except
> on E: EBadValueError do
> begin
> //TmpFld.FocusControl;
> raise
> end
> end
> end
>end;
>
>The problem is that TmpFld.FocusControl does nothing. But maybe it's not
>the correct usage?
*before* raising the exception.
Helen