SSTab Control?-VBForums
Results 1 to 10 of 10

Thread: SSTab Control?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    80

    SSTab Control?

    How would I go about adding tabs dynamically everytime a timer ticks or something of the sort with a sstab control, and be able to automatically have items like a textbox on the tab before the user tabs to it.

  2. #2
    Fanatic Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    659

    Re: SSTab Control?

    Question isn't clear...
    Explain better.

    However you should use controls array to load dinamically TextBox or other controls.


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    80

    Re: SSTab Control?

    Basically I needed:
    Form1.SSTab1.Tabs = Form1.SSTab1.Tabs + 1
    Then I needed a textbox to be added onto that tab automatically that was in the control array Text1(). I modified alot of my code and got it working with visibility and put all of them on a preexisting tab with a timer. So I worked out a solution but would like to know how to dynamically load Text1(Form1.SSTab.Tabs) onto each tab of Form1.SSTab

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Candon City, Ilocos Sur, Phils.
    Posts
    10,785

    Re: SSTab Control?

    To place it in the SStab use the Container property.
    Code:
    Dim txt As TextBox
    
    Set txt = Me.Controls.Add("VB.TextBox", "Text1", Me)
    Set txt.Container = SSTab1
    txt.Visible = True
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    80

    Re: SSTab Control?

    Thanks, but how can i specify a certain tab to be its container?

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    Re: SSTab Control?

    After adding new tab you need to set current tab to be the new one.
    Once you do that then you can assign container property:
    Code:
    Private Sub Command1_Click()
    Dim txt As TextBox
    
        'add new tab
        SSTab1.Tabs = SSTab1.Tabs + 1
        'select new tab
        SSTab1.Tab = SSTab1.Tabs - 1
        'add new textbox
        Set txt = Me.Controls.Add("VB.TextBox", "Text1", Me)
        'set container
        Set txt.Container = SSTab1
        'position new textbox
        txt.Move 300, 1000
        'finally show it
        txt.Visible = True
    
    End Sub

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    Re: SSTab Control?

    If you want to use control arrays then you can do something like this instead:
    Code:
    Private Sub Command1_Click()
    
        'add new tab
        SSTab1.Tabs = SSTab1.Tabs + 1
        'select new tab
        SSTab1.Tab = SSTab1.Tabs - 1
        'add new control
        Load Label1(Label1.UBound + 1)
        Label1(Label1.UBound).Caption = "Label" & Label1.UBound + 1
        'set container
        Set Label1(Label1.UBound).Container = SSTab1
        'position new textbox
        Label1(Label1.UBound).Move 300, 1000
        'finally show it
        Label1(Label1.UBound).Visible = True
    
    End Sub

  8. #8
    Fanatic Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    659

    Re: SSTab Control?

    Quote Originally Posted by RoflItsK View Post
    Basically I needed:
    Form1.SSTab1.Tabs = Form1.SSTab1.Tabs + 1
    Then I needed a textbox to be added onto that tab automatically that was in the control array Text1(). I modified alot of my code and got it working with visibility and put all of them on a preexisting tab with a timer. So I worked out a solution but would like to know how to dynamically load Text1(Form1.SSTab.Tabs) onto each tab of Form1.SSTab
    See project in attach.
    Attached Files Attached Files

  9. #9

  10. #10
    Fanatic Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    659

    Re: SSTab Control?

    Quote Originally Posted by RhinoBull View Post
    gibra,

    how is your sample different from what we already posted?
    I don't use

    Set control.Container = SSTab1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.