Profile Picture

NDockingToolbar persistence

Posted By Craig Swearingen 11 Years Ago
Author
Message
Craig Swearingen
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

I've been using NDockingToolbars just fine but I've disabled letting the user move them around til now.  I've turned on the properties to allow the toolbars to be moved around and that operation works as expected.  I've been trying to persist the toolbar location for several hours now and can't make it work reasonably.

I build my toolbars (1 MenuBar and 2 icon bars) mostly dynamically by adding an NCommand to my NDockingToolbar Commands collection.  Works great. 

I briefly tried using the NCommandBarsState class to save my toolbars state.  When I loaded a saved state my click events on my commands were unknown.  I gave up at that point.  I would imagine the way I build my toolbars is not compatible with this persisting approach. 

Thus I'm trying to persist the toolbar Dock, Location, and RowIndex properties.  I don't allow the user to edit the toolbars themselves so I was hoping that would be sufficient to remember and it nearly is.

1) When calling toolbar.Dock = DockStyle.None my toolbar properly floats out from the docked position.  If I then call toolbar.Dock = DockStyle.Top the toolbar docks back at the top but its height is wrong and it continues to show parts of the floated toolbar visual.  I've tried setting the above properties in different orders and using the NCommandBarsManager Suspend/ResumeDockLayout methods as well as setting the FloatingSize/Location to 0 but nothing helps.  Works great when the user docks using the mouse.  What else can I do programatically to get the visual to look the same?  (I attached a scribbled out picture of this docked toolbar visual issue.)

2) I read on this forum that the ability to move a toolbar above the menu bar (which is a toolbar too) is by design.  Someone has already asked if there was a way to stop this.  I can't think of a single application that has allowed me to move my toolbars above a menu bar.  This should be optional.  I briefly tried persisting my menubar as a toolbar too so as to accomodate the user doing this and began getting some form of exception (not in my code).  I did not persue this further.

3) I tried setting CanFloat to false.  When doing this the user can't move the toolbar to any other dock state.  I was hoping they could move it around the borders but it seems its stuck.  Anyway to not support float but move around all borders?

I'm running on Win7 using build 11.12.14.12.  I would appreciate any suggestions on the proper persisting of toolbars and recommendations on these issues I've seen.



Attachments
dockedtoolbarvisual.GIF (373 views, 8.00 KB)



Similar Topics


Reading This Topic