อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


IUIService.Styles Property

Definition

Gets the collection of styles that are specific to the host's environment.

C#
public System.Collections.IDictionary Styles { get; }

Property Value

An IDictionary containing style settings.

Examples

The following code example gets the dialog box font from the host environment.

C#
// 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;
}

Remarks

The dictionary can provide information from the host environment. At a minimum, this consists of the font that should be used for standard UI text, and the color to use for highlighting. These required styles are "DialogFont" and "HighlightColor".

The values for these styles may be retrieved by using the style as a key for the dictionary, accessing the dictionary using the key as an indexer. For example: (object implementing IUIService).Styles[(style name string in quotes)].

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also