StringFormat 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
封裝文字配置資訊(例如對齊、方向和製表位)顯示操作(例如省略號插入和國家數位替代)和 OpenType 功能。 無法繼承這個類別。
public ref class StringFormat sealed : MarshalByRefObject, ICloneable, IDisposable
public sealed class StringFormat : MarshalByRefObject, ICloneable, IDisposable
type StringFormat = class
inherit MarshalByRefObject
interface ICloneable
interface IDisposable
Public NotInheritable Class StringFormat
Inherits MarshalByRefObject
Implements ICloneable, IDisposable
- 繼承
- 實作
備註
列舉提供了 StringFormatFlags 許多常見的格式。 StringFormat 物件可以被更改。
Note
在 .NET 6 和更新版本中,只有 Windows作系統才支援包含此類型的 System.Drawing.Common 套件。 跨平台應用程式使用此類會引發編譯時警告及執行時異常。 如需詳細資訊,請參閱 僅限 Windows 上支援的 System.Drawing.Common。
建構函式
| 名稱 | Description |
|---|---|
| StringFormat() |
初始化一個新 StringFormat 物件。 |
| StringFormat(StringFormat) |
從指定的現有StringFormat物件初始化一個新StringFormat物件。 |
| StringFormat(StringFormatFlags, Int32) |
初始化 StringFormat 一個新的物件,使用指定的 StringFormatFlags 列舉方式與語言。 |
| StringFormat(StringFormatFlags) |
初始化一個新 StringFormat 物件,使用指定的 StringFormatFlags 枚舉方式。 |
屬性
| 名稱 | Description |
|---|---|
| Alignment |
取得或設定琴弦的水平對齊。 |
| DigitSubstitutionLanguage |
取得當地數字取代西方數字時所使用的語言。 |
| DigitSubstitutionMethod |
取得用於數字替換的方法。 |
| FormatFlags |
取得或設定 StringFormatFlags 包含格式資訊的枚舉。 |
| GenericDefault |
會拿到一個通用的預設 StringFormat 物件。 |
| GenericTypographic |
會得到一個通用的排版 StringFormat 物件。 |
| HotkeyPrefix |
取得或設定 HotkeyPrefix 該 StringFormat 物件的物件。 |
| LineAlignment |
取得或設定弦的垂直對齊。 |
| Trimming |
取得或設定 StringTrimming 此 StringFormat 物件的枚舉。 |