DesignerOptionService.Options プロパティ

定義

このサービスのオプション コレクションを取得します。

public:
 property System::ComponentModel::Design::DesignerOptionService::DesignerOptionCollection ^ Options { System::ComponentModel::Design::DesignerOptionService::DesignerOptionCollection ^ get(); };
public System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection Options { get; }
member this.Options : System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection
Public ReadOnly Property Options As DesignerOptionService.DesignerOptionCollection

プロパティ値

使用できるデザイナー オプションが設定される DesignerOptionService.DesignerOptionCollection

次のコード例は、 オプションの値を取得できるように、名前付きインデクサーによってコレクション内を移動する方法を GridSize 示しています。 3 つのバリエーションはすべて同じ値を返します。

// Obtains and shows the size of the standard design-mode grid square.
PropertyDescriptor pd;
pd = designerOptionSvc.Options.Properties["GridSize"];
e.Graphics.DrawString("GridSize", 
    new Font("Arial", 8), 
    new SolidBrush(Color.Black), 4, ypos);
e.Graphics.DrawString(pd.GetValue(null).ToString(), 
    new Font("Arial", 8), 
    new SolidBrush(Color.Black), 200, ypos);
ypos += 12;

// Uncomment the following code to demonstrate that this
// alternate syntax works the same as the previous syntax.

//pd = designerOptionSvc.Options["WindowsFormsDesigner"].Properties["GridSize"];
//e.Graphics.DrawString("GridSize",
//    new Font("Arial", 8),
//    new SolidBrush(Color.Black), 4, ypos);
//e.Graphics.DrawString(pd.GetValue(null).ToString(),
//    new Font("Arial", 8),
//    new SolidBrush(Color.Black), 200, ypos);
//ypos += 12;

//pd = designerOptionSvc.Options["WindowsFormsDesigner"]["General"].Properties["GridSize"];
//e.Graphics.DrawString("GridSize",
//    new Font("Arial", 8),
//    new SolidBrush(Color.Black), 4, ypos);
//e.Graphics.DrawString(pd.GetValue(null).ToString(),
//    new Font("Arial", 8),
//    new SolidBrush(Color.Black), 200, ypos);
//ypos += 12;
' Obtains and shows the size of the standard design-mode grid square.
Dim pd As PropertyDescriptor
pd = designerOptionSvc.Options.Properties("GridSize")

e.Graphics.DrawString("GridSize", _
New Font("Arial", 8), _
New SolidBrush(Color.Black), 4, ypos)

e.Graphics.DrawString(pd.GetValue(Nothing).ToString(), _
New Font("Arial", 8), _
New SolidBrush(Color.Black), 200, ypos)

ypos += 12

' Uncomment the following code to demonstrate that this
' alternate syntax works the same as the previous syntax.
'pd = designerOptionSvc.Options["WindowsFormsDesigner"].Properties["GridSize"];
'e.Graphics.DrawString("GridSize",
'    new Font("Arial", 8),
'    new SolidBrush(Color.Black), 4, ypos);
'e.Graphics.DrawString(pd.GetValue(null).ToString(),
'    new Font("Arial", 8),
'    new SolidBrush(Color.Black), 200, ypos);
'ypos += 12;
'pd = designerOptionSvc.Options["WindowsFormsDesigner"]["General"].Properties["GridSize"];
'e.Graphics.DrawString("GridSize",
'    new Font("Arial", 8),
'    new SolidBrush(Color.Black), 4, ypos);
'e.Graphics.DrawString(pd.GetValue(null).ToString(),
'    new Font("Arial", 8),
'    new SolidBrush(Color.Black), 200, ypos);
'ypos += 12;

注釈

子コレクションを含むグローバル オプション コレクションは常に存在します。

適用対象

こちらもご覧ください