Not sure what is going wrong here. I have a PageControl on a form with two tabs.
On Tab One I have a TStringGrid on Tab Two I have a button. The StringGrid has OnDoubleClick set to change the Active Tab to Tab2 - see code below...
The Tab changes, but when I click on the Button on Tab Two, I get an exception "EInvalidOperation with the message: Cannot focus a disabled or invisible window"
This is on Mac OS: 10.15.3 (19D76) - Lazarus Version #: 2.0.6 -Date: 2019-11-05 - FPC Version: 3.0.4
Anyone an idea how I fix this?
Thanks
type
{ TForm1 }
TForm1 = class(TForm)
Button2: TButton; // Button on Tabsheet2
PageControl1: TPageControl;
StringGrid1: TStringGrid; // On TabSheet1
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
procedure StringGrid1DblClick(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.StringGrid1DblClick(Sender: TObject);
begin
PageControl1.ActivePage := TabSheet2;
end;
end.