![]() |
Save/Load State |
Post Reply ![]() |
Author | |
griswald88 ![]() Groupie ![]() Joined: 16 May 2008 Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Can you modify some our project and attach to check what you do.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
griswald88 ![]() Groupie ![]() Joined: 16 May 2008 Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
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?uploads/20080723_083639_SDISample.zip
|
|
![]() |
|
Baldur ![]() Senior Member ![]() Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
griswald88 ![]() Groupie ![]() Joined: 16 May 2008 Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
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)
|
|
![]() |
|
Baldur ![]() Senior Member ![]() Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
![]() ![]() ![]() ![]() ![]() |
Use the FindControl-Method and assign the new handle.
|
|
![]() |
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 |