比如说pgc1有三个父页ts1,ts2,ts3
ts1的子页在pgc2上为ts11,ts12,ts13。
ts2的子页在pgc2上为ts21,ts22,ts23。
ts3的子页在pgc2上为ts31,ts32,ts33。
怎么能每次点击ts1的时候默认显示ts11,点击ts2的时候默认显示ts21,点击ts3的时候默认ts31。

解决方案 »

  1.   

    procedure TForm1.PageControl1Change(Sender: TObject);
    begin
      case PageControl1.ActivePageIndex of
        0: PageControl2.ActivePageIndex := 0;
        1: PageControl3.ActivePageIndex := 0;
        2: PageControl4.ActivePageIndex := 0;
      end;
    end;
      

  2.   

    pagecontrol1.activepage:=tabsheet1不行么?我一直这样用阿~
      

  3.   

    比如说pgc1有三个父页ts1,ts2,ts3
    ts1的子页在pgc2上为ts11,ts12,ts13。
    ts2的子页在pgc3上为ts21,ts22,ts23。
    ts3的子页在pgc4上为ts31,ts32,ts33。
    怎么能每次点击ts1的时候默认显示ts11,点击ts2的时候默认显示ts21,点击ts3的时候默认ts31。
      

  4.   

    在pgc1的Change事件中,添加以下代码:
    case pgc1.ActivePage.PageIndex of
      0:pgc2.ActivePageIndex:=0;
      1:pgc3.ActivePageIndex:=0;
      2:pgc4.ActivePageIndex:=0;
    end;
      

  5.   

    这样可以呀,在相应的onchange中写代码就可以了,