Icon View Incident Report

Serious Serious
Reported By: Walter Matte [Tactical Business Corporat
Reported On: 9/27/2015
For: Version 2.01 Build 2
# 4244 Changing the TPagePanel ActivePage Property in Code Not Equivalent to Clicking on Tab for Focus

Changes Pages in code by changing ActivePage - is not the same as clicking the Page Tab.

If I change the page in code by setting the ActivePage - then close the form - when I show the form again, it is NOT on the page I set via ActivePage. but if I click the Tab of the page, then close, when I show the form again, it is on the Page I expect (want).

function TForm2.Form2CloseQuery(Sender: TObject): Boolean;
begin
  if pagepanel1.activepage <> page1 then
    result := false
  else
    result := true;

  pagepanel1.activepage := page1;
  page1.SetFocus; // Workaround !!!!
end;

procedure TForm2.Form2Close(Sender: TObject);
begin
  form1.show;
end;



Comments Comments and Workarounds
The workaround was to manually focus the TPage instance after setting the ActivePage property. The problem was caused by the fact that the base TControl class was saving non-focusable controls like the TPage control as the last active control when showing/hiding forms.


Resolution Resolution
Fixed Problem on 9/28/2015 in version 2.02 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image