Subscript out of range error when adding a new tab with a panel after removing one

Summary

Id:2767.6
Type:Bug Bug
Current Status:Resolved

Detail

27 Mar 2003OpenMichael Elashoff

Thanks for the great Visual Studio Tab Control. One issue to be aware of is if you add tabs with panel controls, remove some tabs, then add some new abs you get a subscript out of range error when you try setting the panel control for those new tabs.

14 Apr 2003Resolution IdentifiedMatt

The fTabPanel Let Property is incorrect, as shown below:

Friend Property Let fTabPanel(ByVal lId As Long, ByVal ctlThis As Object) Dim ctlPanel As Object Dim lIndex As Long If (getTabForId(lId, lIndex)) Then'''''If pbGetTabPanel(lId, ctlPanel) Then If pbGetTabPanel(lIndex, ctlPanel) Then 'use the index we just asked for rather the the id pbPanelVisible ctlPanel, False........etc.

Also, added this to the bottom of the pRemove procedure to reshow the panel that has now has focus after removal of the old tab.....

drawTabs 'Reshow the new selected panel If m_iSelTab > 0 Then If (pbGetTabPanel(m_iSelTab, ctl)) Then pbPanelVisible ctl, True End If End If
11 May 2003ResolvedSteve McMahon

Fixed erroneous code.