I’ve discovered a recent defect in the MS Common Controls Tab and it seems to be undocumented. So, I’ll document it here for the next poor sap. This applies to Visual Basic 6 and Microsoft Common Controls 6.1, MSCOMCTL.OCX 6.1.97.82 February 23, 2004. Perhaps it was fixed in and earlier or later version. If so, it would be nice if that fix was easy to find on the ‘net.
If you put a string that that only contains valid number characters into a tab’s Key property and error results. If you are suppressing errors in this section of code, like we are, then you won’t notice until you pull the Key property and a blank string comes back.
Dim tabPage As MSComctlLib.Tab
If (m_col.Count = 0) Then
Set tabPage = m_TabStrip.Tabs(1)
Else
Set tabPage = m_TabStrip.Tabs.Add
End If
tabPage.Caption = sName
tabPage.Key = sName
The solution sucks. Basically, the Key property is unuseable, but lots of code is already depending on it. So, if sName is numeric I can prefix/suffix an obviously non-numeric character and then go fix all the code to look for this character. Or I can do this on ALL strings put into the Key property.