请教VB6中的TabStrip控件的详细使用方法
1个回答
2016-12-15 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517204
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
TabStrip 例子 (一)
===============================================================
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "comctl32.ocx"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2760
ClientLeft = 1635
ClientTop = 1545
ClientWidth = 3420
LinkTopic = "Form1"
ScaleHeight = 2760
ScaleWidth = 3420
Begin VB.Frame ChoiceFrame
BorderStyle = 0 'None
Height = 1695
Index = 1
Left = 1800
TabIndex = 2
Top = 1560
Width = 2655
Begin VB.OptionButton DogsOption
Caption = "Bohdi"
Height = 255
Index = 3
Left = 240
TabIndex = 11
Top = 1200
Width = 975
End
Begin VB.OptionButton DogsOption
Caption = "Mahto"
Height = 255
Index = 2
Left = 240
TabIndex = 10
Top = 840
Width = 975
End
Begin VB.OptionButton DogsOption
Caption = "Veda"
Height = 255
Index = 1
Left = 240
TabIndex = 9
Top = 480
Width = 975
End
Begin VB.OptionButton DogsOption
Caption = "Snortimer"
Height = 255
Index = 0
Left = 240
TabIndex = 8
Top = 120
Value = -1 'True
Width = 975
End
End
Begin VB.Frame ChoiceFrame
BorderStyle = 0 'None
Height = 1695
Index = 2
Left = 1080
TabIndex = 3
Top = 1080
Width = 2655
Begin VB.OptionButton PoepleOption
Caption = "Darcy"
Height = 255
Index = 3
Left = 240
TabIndex = 7
Top = 1200
Width = 1095
End
Begin VB.OptionButton PoepleOption
Caption = "Julia"
Height = 255
Index = 2
Left = 240
TabIndex = 6
Top = 840
Width = 1095
End
Begin VB.OptionButton PoepleOption
Caption = "Michelle"
Height = 255
Index = 1
Left = 240
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.OptionButton PoepleOption
Caption = "Rod"
Height = 255
Index = 0
Left = 240
TabIndex = 4
Top = 120
Value = -1 'True
Width = 1095
End
End
Begin VB.Frame ChoiceFrame
BorderStyle = 0 'None
Height = 1695
Index = 0
Left = 360
TabIndex = 1
Top = 600
Width = 2655
Begin VB.OptionButton CatsOption
Caption = "Corky"
Height = 255
Index = 2
Left = 240
TabIndex = 14
Top = 840
Width = 1335
End
Begin VB.OptionButton CatsOption
Caption = "Cobe"
Height = 255
Index = 1
Left = 240
TabIndex = 13
Top = 480
Width = 1335
End
Begin VB.OptionButton CatsOption
Caption = "Merlin"
Height = 255
Index = 0
Left = 240
TabIndex = 12
Top = 120
Value = -1 'True
Width = 1335
End
End
Begin ComctlLib.TabStrip TabStrip1
Height = 2175
Left = 240
TabIndex = 0
Top = 240
Width = 2895
_ExtentX = 5106
_ExtentY = 3836
_Version = 327682
BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7}
NumTabs = 3
BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "&Cats"
Object.Tag = ""
ImageVarType = 2
EndProperty
BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "&Dogs"
Object.Tag = ""
ImageVarType = 2
EndProperty
BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7}
Caption = "&People"
Object.Tag = ""
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' Note that the TabStrip numbers tabs starting
' with 1 not 0.
' The index of the selected frame.
Private SelectedTab As Integer
Private Sub Form_Load()
Dim i As Integer
' Move all the frames to the same position
' and make them all invisible.
For i = 1 To ChoiceFrame.UBound
ChoiceFrame(i).Move _
ChoiceFrame(0).Left, _
ChoiceFrame(0).Top, _
ChoiceFrame(0).Width, _
ChoiceFrame(0).Height
ChoiceFrame(i).Visible = False
Next i
' Select the first tab.
SelectedTab = 1
TabStrip1.SelectedItem = TabStrip1.Tabs(SelectedTab)
ChoiceFrame(SelectedTab - 1).Visible = True
End Sub
Private Sub TabStrip1_Click()
ChoiceFrame(SelectedTab - 1).Visible = False
SelectedTab = TabStrip1.SelectedItem.Index
ChoiceFrame(SelectedTab - 1).Visible = True
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询