This topic has not yet been rated - Rate this topic

IDesignerOptionService.SetOptionValue Method

Sets the value of the specified Windows Forms Designer option.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)
void SetOptionValue(
	string pageName,
	string valueName,
	Object value
)

Parameters

pageName
Type: System.String
The name of the page that defines the option.
valueName
Type: System.String
The name of the option property.
value
Type: System.Object
The new value.

The pageName parameter should consist of "WindowsFormsDesigner\CategoryName", where CategoryName is an options category name without any white space characters. The category name is typically "General". Therefore, you can access the "General" designer options category with the English page name "WindowsFormsDesigner\General".

Note Note

The page and value names are always expected in English. Therefore, the following table is provided to help you access the options you want.

The following table indicates the English value names, their data format, and a description of each:

Value Name

Value Format

Description

GridSize

Size

The size of each grid square.

GridSize.Width

Int32

The width of each grid square. This nested property is read-only when accessed through the designer option service.

GridSize.Height

Int32

The height of each grid square. This nested property is read-only when accessed through the designer option service.

ShowGrid

Boolean

true if the grid should be shown; false if the grid should not be shown.

SnapToGrid

Boolean

true if the positions of the components should be aligned to the grid; false if the positions should not necessarily be aligned.

LayoutMode

Microsoft.VisualStudio.Windows.Forms.LayoutMode

SnapLines to use snaplines, or SnapToGrid to align controls to the grid,

ObjectBoundSmartTagAutoShow

Boolean

true to allow a component's smart tag panel to open automatically upon creation; otherwise, false.

AutoToolboxPopulate

Boolean

true to automatically add a solution's custom controls and components to the Toolbox; otherwise, false.

UseOptimizedCodeGeneration

Boolean

true if the component cache is enabled; otherwise, false.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ