tabbed dialog control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: tabbed dialog control

  1. #1
    C.J. Guest

    tabbed dialog control


    how do I set the properties or write the code for a microsoft tabbed dialog
    control if I want to use 3 tabs displaying different information on each
    tab...please help...

    CJ

  2. #2
    Russ Guest

    Re: tabbed dialog control


    "C.J." <chyter@yahoo.com> wrote:
    >
    >how do I set the properties or write the code for a microsoft tabbed dialog
    >control if I want to use 3 tabs displaying different information on each
    >tab...please help...
    >
    >CJ


    CJ,
    Not to hammer this point into the ground, but as I mentioned to Stan below,
    you are better off not using the SSTab. Use the TabStrip instead. Here's
    a working example of how to use the TabStrip. (This is basically from the
    VB help).

    You will need a reference to 'Microsoft Windows Common Controls 6.0' under
    Project->Components. Place a TabStrip control on your form, then add three
    frames and name them all 'Frames'. This will create a control array so you
    can reference them as Frames(0), Frames(1) and Frames(2). You can then place
    the controls you want to show on each tab, inside the respective frames.

    -Russ.

    '*************************************
    Option Explicit

    Private mintCurFrame As Integer ' Current Frame visible

    Private Sub Form_Load()
    mintCurFrame = 1
    Frames(0).Visible = True
    Frames(1).Visible = False
    Frames(2).Visible = False
    TabStrip1.Tabs(1).Selected = True
    End Sub

    Private Sub Form_Resize()
    Dim i As Integer
    TabStrip1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
    For i = 0 To Frames.Count - 1
    Frames(i).Move 120, 360, Me.ScaleWidth - 240, Me.ScaleHeight - 480
    Next i
    End Sub

    Private Sub Tabstrip1_Click()
    If TabStrip1.SelectedItem.Index = mintCurFrame Then
    Exit Sub ' No need to change frame.
    End If
    ' Otherwise, hide old frame, show new.
    Frames(TabStrip1.SelectedItem.Index - 1).Visible = True
    Frames(mintCurFrame - 1).Visible = False
    ' Set mintCurFrame to new value.
    mintCurFrame = TabStrip1.SelectedItem.Index
    End Sub




  3. #3
    C.J. Guest

    Re: tabbed dialog control


    Thanks Russ, but now what if i want to use 4 tabs instead of 1. This code
    only gernerates only 1 tab.


    "Russ" <russell.thompson@adlink.com> wrote:
    >
    >"C.J." <chyter@yahoo.com> wrote:
    >>
    >>how do I set the properties or write the code for a microsoft tabbed dialog
    >>control if I want to use 3 tabs displaying different information on each
    >>tab...please help...
    >>
    >>CJ

    >
    >CJ,
    >Not to hammer this point into the ground, but as I mentioned to Stan below,
    >you are better off not using the SSTab. Use the TabStrip instead. Here's
    >a working example of how to use the TabStrip. (This is basically from the
    >VB help).
    >
    >You will need a reference to 'Microsoft Windows Common Controls 6.0' under
    >Project->Components. Place a TabStrip control on your form, then add three
    >frames and name them all 'Frames'. This will create a control array so

    you
    >can reference them as Frames(0), Frames(1) and Frames(2). You can then

    place
    >the controls you want to show on each tab, inside the respective frames.
    >
    >-Russ.
    >
    >'*************************************
    >Option Explicit
    >
    >Private mintCurFrame As Integer ' Current Frame visible
    >
    >Private Sub Form_Load()
    > mintCurFrame = 1
    > Frames(0).Visible = True
    > Frames(1).Visible = False
    > Frames(2).Visible = False
    > TabStrip1.Tabs(1).Selected = True
    >End Sub
    >
    >Private Sub Form_Resize()
    > Dim i As Integer
    > TabStrip1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
    > For i = 0 To Frames.Count - 1
    > Frames(i).Move 120, 360, Me.ScaleWidth - 240, Me.ScaleHeight - 480
    > Next i
    >End Sub
    >
    >Private Sub Tabstrip1_Click()
    > If TabStrip1.SelectedItem.Index = mintCurFrame Then
    > Exit Sub ' No need to change frame.
    > End If
    > ' Otherwise, hide old frame, show new.
    > Frames(TabStrip1.SelectedItem.Index - 1).Visible = True
    > Frames(mintCurFrame - 1).Visible = False
    > ' Set mintCurFrame to new value.
    > mintCurFrame = TabStrip1.SelectedItem.Index
    >End Sub
    >
    >
    >



  4. #4
    Russ Guest

    Re: tabbed dialog control


    "C.J." <chyter@yahoo.com> wrote:
    >
    >Thanks Russ, but now what if i want to use 4 tabs instead of 1. This code
    >only gernerates only 1 tab.
    >
    >


    Sorry, you have to go into the properties dialog for the TabStrip (double-click
    '(Custom)' in the Properties window), and add your tabs there. You will
    need a frame on your form for every tab you add to the TabStrip.

    -Russ.

  5. #5
    C.J. Guest

    Re: tabbed dialog control


    Thanks a lot man...


    "Russ" <russell.thompson@adlink.com> wrote:
    >
    >"C.J." <chyter@yahoo.com> wrote:
    >>
    >>Thanks Russ, but now what if i want to use 4 tabs instead of 1. This code
    >>only gernerates only 1 tab.
    >>
    >>

    >
    >Sorry, you have to go into the properties dialog for the TabStrip (double-click
    >'(Custom)' in the Properties window), and add your tabs there. You will
    >need a frame on your form for every tab you add to the TabStrip.
    >
    >-Russ.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center