Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
462
Tab that creates new tabs when clicked
posted

I would like to create a "New Tab" tab (similar in function to IE 7 new tab button). This Tab, when clicked, creates an additional tab by adding an object to the underlying datasource.    I don't seem to be able to add a tab directly to a databound UltraWinTabControl so I created a "fake" object and  added that to the datasource.

My  code: 

Private Sub LinesTabs_ActiveTabChanging(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabControl.ActiveTabChangingEventArgs) Handles LinesTabs.ActiveTabChanging

        If e.Tab.Text = "Add" Then
            e.Cancel = True 'prevent add tab from being switched to
           'add new object to datasource
        End If

 The problem is the Add tab is automatically selected when there is no other tabs (either because it is the only tab that exists in the UltraWinTabControl or it becomes that way by removing all other tabs).  This fires the add new object code without the tab being clicked on.

...How do I go about making this work? or is there some better way of achieving similar functionality