根据我所了解到的情况,Adroit Technologies已经停业多年,他们的VB6 SmartTabs和OutlookBar控件也不再得到维护和更新。然而,如果您仍然想在VB6中使用类似的控件,您可以尝试找到其他提供类似控件的第三方库,或者尝试自己编写自定义控件。
在下面的代码示例中,我将演示如何编写自定义TabControl控件。这个控件功能类似于SmartTabs控件,它可以让用户切换页面并自定义标签页的外观。
首先,在VB6中创建一个新的用户控件,将其命名为CustomTabControl。然后,从工具箱中拖动一个TabControl控件和一个ImageList控件到这个用户控件上。将TabControl控件的Visible属性设置为False。
然后在代码中添加以下内容:
'Custom Control Declaration
Option Explicit
Private m_tabStrip As TabStrip
Private m_tabPages As Collection
Private m_Images As ImageList
'Events
Public Event Change(ByVal Index As Integer)
'Properties
Public Property Get TabCount() As Integer
TabCount = m_tabStrip.Tabs.Count
End Property
Public Property Get ImageList() As ImageList
Set ImageList = m_Images
End Property
Public Property Set ImageList(ByVal vNewValue As ImageList)
Dim i As Integer
Set m_Images = vNewValue
Set m_tabStrip.ImageList = m_Images
For i = 1 To m_tabStrip.Tabs.Count
m_tabStrip.Tabs(i).ImageIndex = i - 1
Next
End Property
Public Property Let TabCaption(ByVal Index As Integer, ByVal vNewValue As String)
m_tabStrip.Tabs(Index).Caption = vNewValue
End Property
Public Property Get TabCaption(ByVal Index As Integer) As String
TabCaption