IUIService.Styles Özellik

Tanım

Konağın ortamına özgü stil koleksiyonunu alır.

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

Özellik Değeri

İçeren IDictionary stil ayarları.

Örnekler

Aşağıdaki kod örneği, iletişim kutusu yazı tipini konak ortamından alır.

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

Açıklamalar

Sözlük, konak ortamından bilgi sağlayabilir. En azından bu, standart kullanıcı arabirimi metni için kullanılması gereken yazı tipinden ve vurgulama için kullanılacak renkten oluşur. Bu gerekli stiller "DialogFont" ve "HighlightColor" stilleridir.

Bu stillerin değerleri, stili sözlüğün anahtarı olarak kullanılarak alınabilir ve anahtar dizin oluşturucu olarak kullanılarak sözlüğe erişilebilir. Örneğin: (nesne uygulayan IUIService). Stiller[(tırnak içinde stil adı dizesi)].

Şunlara uygulanır

Ayrıca bkz.