Thnx for the UniCombo

Is it possible to use string as ItemData or in the future maby add class or object as ComboItem, like in .NET?
BR;
Meelis
Code: Select all
Private Function GetTabTag(ByVal tsTab As TabStripCtlLibUCtl.TabStripTab) As String
Dim pMem As Long
Dim s As String
Dim sz As Long
If Not (tsTab Is Nothing) Then
pMem = tsTab.TabData
If pMem Then
CopyMemoryNew VarPtr(sz), pMem, 4
s = String$(sz / 2, Chr$(0))
CopyMemoryNew StrPtr(s), pMem + 4, sz
End If
End If
GetTabTag = s
End Function
Private Sub FreeTabTag(ByVal tsTab As TabStripCtlLibUCtl.TabStripTab)
If Not (tsTab Is Nothing) Then
If tsTab.TabData <> 0 Then
HeapFree GetProcessHeap(), 0, tsTab.TabData
tsTab.TabData = 0
End If
End If
End Sub
Private Sub SetTabTag(ByVal tsTab As TabStripCtlLibUCtl.TabStripTab, ByVal Tag As String)
Const HEAP_ZERO_MEMORY = &H8
Dim pMem As Long
Dim sz As Long
If Not (tsTab Is Nothing) Then
If tsTab.TabData <> 0 Then FreeTabTag tsTab
sz = LenB(Tag)
pMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz + 4)
If pMem Then
CopyMemoryNew pMem, VarPtr(sz), 4
CopyMemoryNew pMem + 4, StrPtr(Tag), sz
tsTab.TabData = pMem
End If
End If
End Sub
Private Sub TabStrip1_FreeTabData(ByVal tsTab As TabStripCtlLibUCtl.ITabStripTab)
If Not tsTab Is Nothing Then
FreeTabTag tsTab
End If
End Sub