This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

Avoid setting of ActivePage = nil which causes problems

edited May 2014 in LMD ElPack
Can you change the methode
  TElPageControl.PMRefreshActivePage

and add following line befor setting ActivePage

    if Assigned(ASheet) then
      ActivePage := ASheet;

It is a bad Idea to set the active page to nil because in some other methodes of TElpageControl a ActivePage set to nil isn't expected.




Comments

  • Hi,

    or maybe better:

        if CanChange(ASheet, false) then
          FActivePage := nil
        else
          ASheet := FindNextPage(ActivePage, True, True, True);

        if not Assigned(ASheet) and (ActivePage.Visible) then
          ASheet := ActivePage
        else
          ASheet := FindNextPage(ActivePage, True, True, False);

        ActivePage := ASheet;

    The problem appears if all tabs are deactivated...

    Bye

    Andre
  • That is right:

        if not Assigned(ASheet) then
        begin
          if ActivePage.Visible then
            ASheet := ActivePage
          else
            ASheet := FindNextPage(ActivePage, True, True, False);
        end;

Sign In or Register to comment.