IUIService.Styles 속성

정의

호스트 환경에 고유한 스타일 컬렉션을 가져옵니다.

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

속성 값

IDictionary

스타일 설정이 포함된 IDictionary입니다.

예제

다음 코드 예제에서는 호스트 환경에서 대화 상자 글꼴을 가져옵니다.

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

설명

사전은 호스트 환경의 정보를 제공할 수 있습니다. 최소한 표준 UI 텍스트에 사용해야 하는 글꼴과 강조 표시에 사용할 색으로 구성됩니다. 이러한 필수 스타일은 "DialogFont" 및 "HighlightColor"입니다.

이러한 스타일에 대한 값은 사전의 키로 스타일을 사용하여 인덱서로 키를 사용하여 사전에 액세스하여 검색할 수 있습니다. 예: (개체 구현 IUIService). Styles[(스타일 이름 문자열(따옴표)].

적용 대상

추가 정보