//
you're reading...
.NET 2.0

Quick post regarding ToolStrips

When working with the new ToolStrips you probably want to save the user’s preferences for positioning of the strips, this is easily accomplished by the following code:

ToolStripManager.SaveSettings( myForm, "optionalKey" );

Likewise loading the preferences is as simple as:

ToolStripManager.LoadSettings( myForm, "optionalKey" );

However if you combine designer generated code and your own written code to create new tool strips you will find that the LoadSettings method is causing your hand coded tool strips to disappear. Fortunately there is an easy fix, simply setting the Name property on the hand coded ToolStrips will cause the Save/Load to respect them again.

Unfortunately, if you add a new tool strip to the application before the Save has been called on it, the Load will again cause them to be hidden.

Now I’m off to sleep…

Advertisements

About James

I am a Senior Developer/Consultant for InfoPlanIT, LLC. I previously spent over 7 years as a Product Manager for what eventually became ComponentOne, a division of GrapeCity. While there, I helped to create ActiveReports 7, GrapeCity ActiveAnalysis, and Data Dynamics Reports.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archive

%d bloggers like this: