Print Page | Close Window

Save/Load State

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11543
Printed Date: 07 October 2024 at 4:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Save/Load State
Posted By: griswald88
Subject: Save/Load State
Date Posted: 22 July 2008 at 2:31pm
I have commandbars that have embedded controls (i.e. combo box and textbox) and I am trying to save and reload the state of the bars.  When I reload the state, the controls are missing and the commandbar height is much larger.  Is there something I am doing wrong?



Replies:
Posted By: Oleg
Date Posted: 23 July 2008 at 1:46am

Hi,

Can you modify some our project and attach to check what you do.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: griswald88
Date Posted: 23 July 2008 at 8:36am
Here is a modified SDISample project.  Please note it will ask you if it is the first time running the sample, so the 1st time, select YES.  Once the sample loads and displays move the toolbars around and then close the form (end the project).  Start it up again and this time, answer NO to "is this the first time running the sample, this will attempt to reload the last state.  Note how the controls are missing.  Am I doing something wrong? https://forum.codejock.com/uploads/20080723_083639_SDISample.zip - uploads/20080723_083639_SDISample.zip


Posted By: Baldur
Date Posted: 23 July 2008 at 2:06pm
If you add custom-controls, you add its handle (the hwnd-property).
This handle will be changed with very start, so you can't save this state.
After load state, you have to reassign the custom controls with the new handles.


Posted By: Oleg
Date Posted: 24 July 2008 at 4:57am
Hi,
 
yes, reason that hwnd will be new. As solution you can set Customizable = False for toolbar with custom controls or manually restore handle of custom control.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: griswald88
Date Posted: 24 July 2008 at 8:19am
Customizable IS false, but the user is still able to modify the toolbar's position...so I also want to restore this new position (without using registry)


Posted By: Baldur
Date Posted: 24 July 2008 at 2:32pm
Use the FindControl-Method and assign the new handle.



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