Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Avoid setting of ActivePage = nil which causes problems

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

  • 3 Comments sorted by Votes Date Added
  • 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.