DesignerOptionService.Options Propriété

Définition

Obtient la collection d'options de ce service.

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

Valeur de propriété

DesignerOptionService.DesignerOptionCollection rempli avec les options de concepteur disponibles.

Exemples

L’exemple de code suivant montre comment parcourir les collections à l’aide d’indexeurs nommés afin d’obtenir la valeur de l’option GridSize . Les trois variantes retournent la même valeur.

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

Remarques

Il existe toujours une collection d’options globales qui contient des collections enfants.

S’applique à

Voir aussi