StringFormat 類別

定義

封裝文字配置資訊 (例如對齊、方向和定位停駐點)、顯示管理 (例如省略符號插入和國家數字取代) 和 OpenType 功能。Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. 這個類別無法被繼承。This class cannot be inherited.

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
繼承
StringFormat
實作

備註

許多常見的StringFormatFlags格式都是透過列舉來提供。Many common formats are provided through the StringFormatFlags enumeration. StringFormat可以變更物件。StringFormat objects can be changed.

建構函式

StringFormat()

初始化新的 StringFormat 物件。Initializes a new StringFormat object.

StringFormat(StringFormat)

從指定的現有 StringFormat 物件,初始化新的 StringFormat 物件。Initializes a new StringFormat object from the specified existing StringFormat object.

StringFormat(StringFormatFlags)

使用指定的 StringFormatFlags 列舉,初始化新的 StringFormat 物件。Initializes a new StringFormat object with the specified StringFormatFlags enumeration.

StringFormat(StringFormatFlags, Int32)

使用指定的 StringFormatFlags 列舉和語言,初始化新的 StringFormat 物件。Initializes a new StringFormat object with the specified StringFormatFlags enumeration and language.

屬性

Alignment

取得或設定字串的水平對齊方式。Gets or sets horizontal alignment of the string.

DigitSubstitutionLanguage

取得以本地數字取代西式數字時所使用的語言。Gets the language that is used when local digits are substituted for western digits.

DigitSubstitutionMethod

取得要用於數字取代的方法。Gets the method to be used for digit substitution.

FormatFlags

取得或設定包含格式資訊的 StringFormatFlags 列舉。Gets or sets a StringFormatFlags enumeration that contains formatting information.

GenericDefault

取得泛型的預設 StringFormat 物件。Gets a generic default StringFormat object.

GenericTypographic

取得泛型的印刷樣式 StringFormat 物件。Gets a generic typographic StringFormat object.

HotkeyPrefix

取得或設定這個 StringFormat 物件的 HotkeyPrefix 物件。Gets or sets the HotkeyPrefix object for this StringFormat object.

LineAlignment

取得或設定字串的垂直對齊方式。Gets or sets the vertical alignment of the string.

Trimming

取得或設定這個 StringFormat 物件的 StringTrimming 列舉。Gets or sets the StringTrimming enumeration for this StringFormat object.

方法

Clone()

建立這個 StringFormat 物件的完全相同複本。Creates an exact copy of this StringFormat object.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Dispose()

釋放這個 StringFormat 物件使用的所有資源。Releases all resources used by this StringFormat object.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Finalize()

允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetTabStops(Single)

取得這個 StringFormat 物件的定位停駐點。Gets the tab stops for this StringFormat object.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
SetDigitSubstitution(Int32, StringDigitSubstitute)

指定以本地數字取代西式數字時所要使用的語言和方法。Specifies the language and method to be used when local digits are substituted for western digits.

SetMeasurableCharacterRanges(CharacterRange[])

指定 CharacterRange 結構的陣列,代表由 MeasureCharacterRanges(String, Font, RectangleF, StringFormat) 方法的呼叫所測量的字元範圍。Specifies an array of CharacterRange structures that represent the ranges of characters measured by a call to the MeasureCharacterRanges(String, Font, RectangleF, StringFormat) method.

SetTabStops(Single, Single[])

設定這個 StringFormat 物件的定位停駐點。Sets tab stops for this StringFormat object.

ToString()

將這個 StringFormat 物件轉換成人們可讀取的字串。Converts this StringFormat object to a human-readable string.

適用於

另請參閱