怎么把picture加到sstab里边
我加到的都是加到了第一个tab里边
我希望加到第二个tab里怎么办啊?
picture(1).Container=sstab
这样的话就自动加到第1个tab里了

解决方案 »

  1.   

    还要先定位.SSTab1.Tab = N
      

  2.   

    Rs.Open "select * from tableMB where cla=1 and upkey<>0 and upkey<>'" & TabKey(IntKey) & "' and result='" & TabKey(IntKey) & "' and chose=1 order by xkey", Ocn, adOpenDynamic, adLockReadOnly
        Do Until Rs.EOF
            Set ds = TView.Nodes.Add("key" + Trim(Str(Rs.Fields!upkey)), 4, "key" + Trim(Str(Rs.Fields!xkey)), Rs.Fields!xname)
            Rs.MoveNext
            IntNo = IntNo + 1
        Loop
        Rs.Close
        
        TmpLeft = 120
        IntTop = 200
        IntLeft = 120
        TviewNo = 1
        SSTab.Tab = IntKey
        Load Pic(IntKey + 1)
        Pic(IntKey + 1).Width = Pic(0).Width
        Pic(IntKey + 1).Height = Pic(0).Height
        Pic(IntKey + 1).Container = SStab
        StartNo(IntKey) = TviewIndex + 1
        Do Until IsEnd = True
            Load Lab(TviewIndex + 1)
            Lab(TviewIndex + 1).Caption = TView.Nodes(TviewNo).Text
            Lab(TviewIndex + 1).Top = IntTop
            Lab(TviewIndex + 1).Left = IntLeft
            Lab(TviewIndex + 1).Container = Pic(IntKey + 1)
            Lab(TviewIndex + 1).Visible = True
            Load Com(TviewIndex + 1)
            Com(TviewIndex + 1).Top = IntTop - 50
            Com(TviewIndex + 1).Left = IntLeft + 1000
            Com(TviewIndex + 1).Container = Pic(IntKey + 1)
            If TView.Nodes(TviewNo).Children > 0 Then
                Com(TviewIndex + 1).Visible = False
                IntLeft = IntLeft + 1250
                TmpLeft = IntLeft
                TviewNo = TView.Nodes(TviewNo).Child.Index
            Else
                Com(TviewIndex + 1).Visible = True
                If Not (TView.Nodes(TviewNo).Next Is Nothing) Then
                    TviewNo = TView.Nodes(TviewNo).Next.Index
                    IntLeft = IntLeft + Com(TviewIndex + 1).Width + 1100
                    If IntLeft > 10000 - 1000 Then
                        IntLeft = TmpLeft
                        IntTop = IntTop + 350
                    End If
                Else
                    IntTop = IntTop + 500
                    If Not (TView.Nodes(TviewNo).Parent Is Nothing) Then
                        If Not (TView.Nodes(TviewNo).Parent.Next Is Nothing) Then
                            IntLeft = TmpLeft - 1250
                            TviewNo = TView.Nodes(TviewNo).Parent.Next.Index
                        End If
                    Else
                        IsEnd = True
                    End If
                End If
            End If
            TviewIndex = TviewIndex + 1
        Loop
        EndNo(IntKey) = TviewIndex
        Pic(IntKey + 1).Visible = True
        TabKey(IntKey) = 0
        IsEnd = False
      

  3.   

    就是不行,我郁闷,全都在第一个tab上....
      

  4.   

    你的代码好像只装了一个pic吧.Load Pic(IntKey + 1)这句不在循环内
      

  5.   

    不是,我的intkey是传进来的参数,是我自己控制的
    也就是tab的值
    比如我点第1个tab的时候,传进来0,我就load picture(1),并把picture(1)放在此tab上
    如果点我第2个tab的时候,传进来1,我就load picture(2),并把picture(2)放在此tab上
      

  6.   

    \\Pic(IntKey + 1).Container = SStab\\这句好像没用对set Pic(IntKey + 1).Container = SStab
      

  7.   

    set Pic(IntKey + 1).Container = SStab我刚才也注意到了,改成这样还是没用,还是加在第一个上边
    郁闷
      

  8.   

    可以的,你可以用简单的代码先测试一下Private Sub Command1_Click()'在第一个Tab 加一个Picture1
    SSTab1.Tab = 0
    Load Picture1(1)
    Picture1(1).Visible = True
    Picture1(1).Top = 100
    Set Picture1(1).Container = SSTab1
    End SubPrivate Sub Command3_Click()'在第二个Tab 加一个Picture1
    SSTab1.Tab = 1
    Load Picture1(2)
    Picture1(2).Width = Picture1(1).Width
    Picture1(2).Visible = True
    Picture1(2).Top = 200
    Set Picture1(2).Container = SSTab1
    End Sub