I am using a pagecontrol component and I need to add a button and click it to go to a specified page.
How can I do this please?
Add a button to the form and write an OnClick event handler like this:
procedure TMyForm.Button1Click(Sender: TObject);
begin
PageControl1.ActivePage := TabSheet1;
end;
You can use ActivePageIndex:
procedure TForm1.Button1Click(Sender: TObject);
begin
PageControl1.ActivePageIndex := 0;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With