Option Explicit
Private mintCurFrame As Integer' Current Frame visible
Private Sub Tabstrip1_Click()
If Tabstrip1.SelectedItem.Index = mintCurFrame _
Then Exit Sub ' No need to change frame.
' Otherwise, hide old frame, show new.
Frame1(Tabstrip1.SelectedItem.Index).Visible = True
Frame1(mintCurFrame).Visible = False
' Set mintCurFrame to new value.
mintCurFrame = Tabstrip1.SelectedItem.Index
End Sub
发行注意 TabStrip 控件是一组自定义控件的一部分,这组自定义控件可以在文件 MSCOMCTL.OCX 中找到。为了在应用程序中使用 TabStrip 控件,必须将文件 MSCOMCTL.OCX 添加到工程中去。当发布应用程序时,要把文件 MSCOMCTL.OCX 安装到用户的 Microsoft Windows SYSTEM 目录下。关于如何在工程中添加自定义控件的详细信息,请参阅《程序员指南》。