Export (0) Print
Expand All

IDesignerOptionService.SetOptionValue Method

Sets the value of the specified Windows Forms Designer option.

[Visual Basic]
Sub SetOptionValue( _
   ByVal pageName As String, _
   ByVal valueName As String, _
   ByVal value As Object _
)
[C#]
void SetOptionValue(
   string pageName,
 string valueName,
 object value
);
[C++]
void SetOptionValue(
   String* pageName,
 String* valueName,
 Object* value
);
[JScript]
function SetOptionValue(
   pageName : String,
 valueName : String,
 value : Object
);

Parameters

pageName
The name of the page that defines the option.
valueName
The name of the option property.
value
The new value.

Remarks

The pageName parameter should consist of WindowsFormsDesigner\ and 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   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 System.Drawing.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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IDesignerOptionService Interface | IDesignerOptionService Members | System.ComponentModel.Design Namespace | GetOptionValue

Show:
© 2014 Microsoft