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 값을 가져올 수 있도록 명명된 인덱서로 컬렉션을 탐색하는 방법을 보여 줍니다. 세 변형 모두 동일한 값을 반환합니다.

// 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;

설명

자식 컬렉션을 포함하는 전역 옵션 컬렉션은 항상 있습니다.

적용 대상

추가 정보