IUIService.Styles Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene la colección de estilos específicos del entorno del host.
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 propiedad
que IDictionary contiene la configuración de estilo.
Ejemplos
En el ejemplo de código siguiente se obtiene la fuente del cuadro de diálogo del entorno host.
// 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
Comentarios
El diccionario puede proporcionar información del entorno host. Como mínimo, se compone de la fuente que se debe usar para el texto de la interfaz de usuario estándar y el color que se va a usar para resaltar. Estos estilos necesarios son "DialogFont" y "HighlightColor".
Los valores de estos estilos se pueden recuperar mediante el uso del estilo como clave para el diccionario, accediendo al diccionario mediante la clave como indexador. Por ejemplo: (objeto que implementa IUIService). Styles[(style name string in quotes)].