Idioma

IUIService.Styles Propriedade

Definição

Obtém a coleção de estilos específicos para o ambiente do anfitrião.

public:
 property System::Collections::IDictionary ^ Styles { System::Collections::IDictionary ^ get(); };
public System.Collections.IDictionary Styles { get; }
member this.Styles : System.Collections.IDictionary
Public ReadOnly Property Styles As IDictionary

Valor de Propriedade

E IDictionary contém definições de estilo.

Exemplos

O exemplo de código seguinte obtém a fonte da caixa de diálogo do ambiente anfitrião.

// The specified IDesigner implements IUIService.
System::Drawing::Font^ GetFont( IDesigner^ designer )
{
   System::Drawing::Font^ hostfont;
   
   // Gets the dialog box font from the host environment.
   hostfont = dynamic_cast<System::Drawing::Font^>(dynamic_cast<IUIService^>(designer)->Styles[ "DialogFont" ]);
   return hostfont;
}
// The specified IDesigner implements IUIService.
Font GetFont(IDesigner designer)
{      
      Font        hostfont;

      // Gets the dialog box font from the host environment. 
      hostfont = (Font)((IUIService)designer).Styles["DialogFont"];
      
      return hostfont;
}
' The specified IDesigner implements IUIService.
Function GetFont(designer As IDesigner) As Font
    Dim hostfont As Font
       
    ' Gets the dialog box font from the host environment.
    hostfont = CType(CType(designer, IUIService).Styles("DialogFont"), Font)
       
    Return hostfont
End Function

Observações

O dicionário pode fornecer informações do ambiente hospedeiro. No mínimo, isto consiste na fonte que deve ser usada para o texto padrão da interface e na cor a usar para realçar. Estes estilos obrigatórios são "DialogFont" e "HighlightColor".

Os valores destes estilos podem ser obtidos usando o estilo como chave para o dicionário, acedendo ao dicionário usando a chave como indexador. Por exemplo: (objeto a implementar IUIService). Estilos[(cadeia de nomes de estilo entre aspas)].

Aplica-se a

Consulte também