[solved] TabControl - problem with closable Items |
Post Reply |
Author | |
readypro
Groupie Joined: 01 March 2011 Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 16 May 2011 at 9:20am |
IDE : VB 6.0
Suite Control v.15.0.1 The NavigateButtonClick event of the TabControl control seems to return always 2 as the ID of the tab being closed Sample code (put 1 commandbutton and 1 tabcontrol on a form) Private Sub Command1_Click() Dim newTab As TabControlItem TabControl1.ShowCloseItemButton = xtpTabItemButtonAlways TabControl1.RemoveAll Set newTab = TabControl1.InsertItem(0, "1st tab", 0, 0) newTab.Closable = True Set newTab = TabControl1.InsertItem(0, "2nd tab", 0, 0) newTab.Closable = True Set newTab = TabControl1.InsertItem(0, "3rd tab", 0, 0) newTab.Closable = True End Sub Private Sub TabControl1_NavigateButtonClick(ByVal Id As Long, Cancel As Variant) MsgBox "Closing tab " & Id ' this displays always "2" Cancel = True End Sub On the manual i've read Id : Id of the tab navigation button that was clicked. It's a bug or it's normal? Thanks |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Its id of navigation button. not Id of tab.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
readypro
Groupie Joined: 01 March 2011 Status: Offline Points: 14 |
Post Options
Thanks(0)
|
Thanks Oleg,
actually i've set ShowCloseItemButton = xtpTabItemButtonSelected and i'm using SelectedItem to detect the clicked tab Is it possible to retrieve also the clicked tab id using ShowCloseItemButton = xtpTabItemButtonAlways or another way to detect the tab that is being closed? |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
and also when u close an item using the closebutton... how do u get the actual itemcount of the tab?
Private Sub TabControl1_NavigateButtonClick(ByVal Id As Long, Cancel As Variant) MsgBox TabControl1.ItemCount End Subthis always return the actual itemcount (not deducting the tab that you closed). does anybody know how to get the itemcount inside navigatebuttonclick event? |
|
sined
Newbie Joined: 13 July 2010 Location: Italy Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Hello,
here the same problem. How to detect the tab that is closing? Mirko
|
|
cmaxmedia
Groupie Joined: 22 April 2006 Location: Austria Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Hi, i have the same Problem: how to detect the tab id/index that is being closed
Private Sub TabControl1_NavigateButtonClick(ByVal Id As Long, Cancel As Variant) MsgBox TabControl1.Selected.Index '<- Nup, thats the active, not the closing tab index!! End Sub |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hi cmaxmedia,
This strange solution was because in first implementation of TabManager there was only one set of navigation buttons for all tabs (separately in tab header). Then navigate buttons were added for every tab, but NavigateButtonClick event stayed the same. I fixed it by adding reference to closed TabControlItem in NavigateButtonClick event. Fix will be available from next beta or final release. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |