Print Page | Close Window

Forms Lost after loadstate?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=18816
Printed Date: 10 May 2024 at 1:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Forms Lost after loadstate?
Posted By: stuc
Subject: Forms Lost after loadstate?
Date Posted: 11 August 2011 at 11:17am


I need a pointer in the right direction if I could.

What would cause the panes to loose their forms?

i.e. After a loadstate, the panes are correctly in their positions its just they are all devoid of their forms

I used the samples for my template and cant for the life of me see why this would happen? - I cant get it to happen with the example code.  Im searching line by line to see what differences I have made. 

A pointer in the general area would be nice



Replies:
Posted By: stuc
Date Posted: 12 August 2011 at 3:47am

[SOLVED]  my mistake thought Id post just in case others find the same.

Incorrect Code

Private Sub DockingPaneManager_AttachPane(ByVal Item As XtremeDockingPane.IPane)

'If Form not create yet.
    If arrPanes(Item.id) Is Nothing Then
        Set arrPanes(Item.id) = frmpandid
           Item.handle = arrPanes(Item.id).hWnd
    End If
End Sub


As you can see I was assigning the Pane handle  (item.handle) only when the array was not populated.  On a loadstate the panes must be being deleted and recreated as it looses the handle.

Corrected code


Private Sub DockingPaneManager_AttachPane(ByVal Item As XtremeDockingPane.IPane)

'If Form not create yet.
    If arrPanes(Item.id) Is Nothing Then
        Set arrPanes(Item.id) = frmpandid
    End If

      Item.handle = arrPanes(Item.id).hWnd       '<<<<<<<<

End Sub




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net