-
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
-
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
-
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
>
>
>
-
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.
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks