Subject | Re: [IBO] FocusControl? |
---|---|
Author | Salvatore Besso |
Post date | 2004-06-29T15:31:24Z |
hello Helen,
extra checks on some fields, and if something is wrong I'd like to focus
the associated control:
var
TmpFld: TIB_Column;
begin
for I := 0 to Pred(My_IB_Query.FieldCount) do
begin
TmpFld := My_IB_Query.Fields[I];
if Assigned(TmpFld) and TmpFld.Visible then
try
if TmpFld.FieldName = 'SOMENAME' then
begin
Make some test on field SOMENAME;
if Something wrong then
raise EBadValueError.Create('The value is bad')
end;
.....
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?
Regards
Salvatore
> What do you want to do? The TIB_Dataset already callsyes, of course, but in the on before post event of the query I'm doing some
> this method itself during the CheckRequiredFields period
> of BeforePost.
extra checks on some fields, and if something is wrong I'd like to focus
the associated control:
var
TmpFld: TIB_Column;
begin
for I := 0 to Pred(My_IB_Query.FieldCount) do
begin
TmpFld := My_IB_Query.Fields[I];
if Assigned(TmpFld) and TmpFld.Visible then
try
if TmpFld.FieldName = 'SOMENAME' then
begin
Make some test on field SOMENAME;
if Something wrong then
raise EBadValueError.Create('The value is bad')
end;
.....
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?
Regards
Salvatore