The following code works !
with pagecontrol1 do
begin
case Myindex of
0: activepage := tabsheet1;
1: activepage := tabsheet2;
2: activepage := tabsheet3;
end;
end;
show;
The following code does not work
with pagecontrol1 do
begin
case Myindex of
0: activepage := tabsheet1;
1: activepage := tabsheet2;
2: activepage := tabsheet3;
end;
end;
showmodal;
how to solve this ?
the problem was when I create a new form in runtime, and set active page before I use showmodal, the command seem to be ignored, however if I show it as normal “show” it works.
I made a workaround for this for people interrested by using a postmessage so the command can be triggered after the modal form is shown.