Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot focus disabled window.

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I am using Delphi 6 Enterprise.

Can someone please tell me the cause of the following exception.

"Cannot focus on disabled window."

I have 4 TGrids (one above the other) on a TForm each of which is hooked to a different IBDataSet on a TDataModule.

I am able to scroll up and down in each grid. But I find if I switch from scrolling in one window - to scrolling in another - I suddenly and unpredicatably get the above exception.

Thanks in advance.

Terry
 
hi,

You are probaly trying to setfocus on an form or a component what is not visible. Some thing like this:

procedure DBgrid.onclick
begin
From2.setfocus;
or
Form2.edit1.setfocus;
end;

And Form2 isn't visible.

Steph [bigglasses]
 
Thanks for that - but actually that can't be the problem.

Because all I have of note (in each grid) is OnDblClick - which isn't being triggered by scrolling.

For what it's worth the event-handler in each case merely amounts to the following (similar for each grid) which purely produces another TForm with a bigger (similar)
TGrid on it - hooked to the same TDataSource.

(Indeed these are the only Procedures on the entire TForm. :) )

procedure TfrmFather.DBGrid1DblClick(Sender: TObject);
begin
frmChildren.ShowModal;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top