views:

664

answers:

1

On main form I have TPageControl and on all of it's tabs I have corresponding Save buttons which are activated on Alt+S combination.

Of course, depending on which tab is opened at the moment, the handler for corresponding Save button should be called; but I get "cannot focus a disabled or invisible window" runtime error if I try to save with Alt+S.

And I've noticed that, the handler of a Save button from the tab which was active before the current tab, is called, but don't know why.

I tried putting Save buttons in panels (it worked fine for some similar problems), but still the same thing happens.

Cheers.

A: 

You could do it all with one button. In the OnClick handler, check which page is the current one, and call the saving function for that page.

Rob Kennedy