Bearbeiten

Freigeben über


ToolStripManager.SaveSettings Method

Definition

Saves settings for the specified Form.

Overloads

SaveSettings(Form)

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

SaveSettings(Form, String)

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

SaveSettings(Form)

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

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

public:
 static void SaveSettings(System::Windows::Forms::Form ^ sourceForm);
public static void SaveSettings (System.Windows.Forms.Form sourceForm);
static member SaveSettings : System.Windows.Forms.Form -> unit
Public Shared Sub SaveSettings (sourceForm As Form)

Parameters

sourceForm
Form

The Form whose name is also the settings key.

Exceptions

sourceForm 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

SaveSettings(Form, String)

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

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

public:
 static void SaveSettings(System::Windows::Forms::Form ^ sourceForm, System::String ^ key);
public static void SaveSettings (System.Windows.Forms.Form sourceForm, string key);
static member SaveSettings : System.Windows.Forms.Form * string -> unit
Public Shared Sub SaveSettings (sourceForm As Form, key As String)

Parameters

sourceForm
Form

The Form for which to save settings.

key
String

A String representing the settings key for this Form.

Exceptions

sourceForm 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