ToolStripManager.LoadSettings Method

Definition

Loads settings for a Form.

Overloads

LoadSettings(Form)

Loads settings for the given Form using the full name of the Form as the settings key.

LoadSettings(Form, String)

Loads settings for the specified Form using the specified settings key.

LoadSettings(Form)

Source:
ToolStripManager.cs
Source:
ToolStripManager.cs
Source:
ToolStripManager.cs

Loads settings for the given Form using the full name of the Form as the settings key.

public static void LoadSettings (System.Windows.Forms.Form targetForm);

Parameters

targetForm
Form

The Form whose name is also the settings key.

Exceptions

targetForm is null.

Remarks

ToolStrip controls that are not on the form at design time when the ToolStrip settings are saved are removed from the Form when the settings are loaded. To reset the settings, comment out the LoadSettings line and leave the SaveSettings line. This will not load any settings and will persist the last state. When you remove the comment from the LoadSettings line, those settings will be applied.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

LoadSettings(Form, String)

Source:
ToolStripManager.cs
Source:
ToolStripManager.cs
Source:
ToolStripManager.cs

Loads settings for the specified Form using the specified settings key.

public static void LoadSettings (System.Windows.Forms.Form targetForm, string key);

Parameters

targetForm
Form

The Form for which to load settings.

key
String

A String representing the settings key for this Form.

Exceptions

targetForm is null.

-or-

key is null or empty.

Remarks

ToolStrip controls that are not on the form at design time when the ToolStrip settings are saved are removed from the Form when the settings are loaded. To reset the settings, comment out the LoadSettings line and leave the SaveSettings line. This will not load any settings and will persist the last state. When you remove the comment from the LoadSettings line, those settings will be applied.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9