hello, i have a UltraDockManager1. I add some panes in run time. panes are right dock
if i close them and click a button (see mi code) the pane i shows again because the pane already exists (UltraDockManager1.DockAreas(0).Panes.count still have 1, that means the pane has no been deleted).
but if i made the dockArea floating and then close the pane AND then click the button, my condition If Not ....DockAreas(0).Panes.Exists(".... then says that the pane no exist. UltraDockManager1.DockAreas(0).Panes.count have a value=0. but when it try to add the pane ( UltraDockManager1.DockAreas(0).Panes.Add(pane) ) an error is throw and says that key already exists but as i said Panes.Exists and Panes.count says that ther are no panes.
the question: is this a bug? o em i doing something wrong?
ps: sorry for my english :P
Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles UltraToolbarsManager1.ToolClick
Select Case e.Tool.Key
Case "btn_informacionGeneral"
UltraDockManager1.Visible = True
If Not UltraDockManager1.DockAreas(0).Panes.Exists("informacionGeneral") Then
Dim Uc_informacionGeneral1 As New uc_informacionGeneral
Dim pane As New Infragistics.Win.UltraWinDock.DockableControlPane("informacionGeneral", "Información general del hotel", Uc_informacionGeneral1)
UltraDockManager1.DockAreas(0).Panes.Add(pane)
Else
UltraDockManager1.DockAreas(0).Panes("informacionGeneral").Show()
End If
UltraDockManager1.DockAreas(0).Panes("informacionGeneral").Activate()
End Select
End Sub
Have you solve the problem?
I think I have the same one.
Closing a pane just means hiding it. It does not actually remove the pane form the ControlPanes collection. When you float a pane, it is removed from it's DockAreaPane and placed in a floating one instead. That's why your code shows that the count is zero. You can run your code when the pane is still floating and open and the count of that first DockAreaPane will still be 0. So when you add the pane again, you are getting a "key already exists" error because the original pane is still in the ControlPanes collection. That is the collection you should be checking to see if the pane exists.