FontUnit.ToString 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 FontUnit 物件轉換成字串表示。
多載
ToString() |
將 FontUnit 物件轉換成預設字串表示。 |
ToString(CultureInfo) |
使用指定的 FontUnit,將 CultureInfo 物件轉換成字串表示。 |
ToString(IFormatProvider) |
使用指定的格式提供者,將 FontUnit 物件轉換成對等字串。 |
ToString()
將 FontUnit 物件轉換成預設字串表示。
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
傳回
FontUnit 物件的字串表示。
備註
ToString使用 方法來擷取 的 FontUnit 字串表示。 Type如果屬性設定 FontSize.AsUnit
為 ,則傳回的字串是 與 屬性中包含的 Unit 字串相等 Unit 的字串。 Type如果屬性設定為任何其他 FontSize 值,則傳回的字串就是值相等的 FontSize 字串。
另請參閱
適用於
ToString(CultureInfo)
使用指定的 FontUnit,將 CultureInfo 物件轉換成字串表示。
public:
System::String ^ ToString(System::Globalization::CultureInfo ^ culture);
public string ToString (System.Globalization.CultureInfo culture);
override this.ToString : System.Globalization.CultureInfo -> string
Public Function ToString (culture As CultureInfo) As String
參數
- culture
- CultureInfo
CultureInfo,包含表示 FontUnit 的文化特性。
傳回
指定文化特性中 FontUnit 物件的字串表示。
備註
ToString使用 方法來擷取指定文化特性中的 字串表示 FontUnit 。 Type如果屬性設定 FontSize.AsUnit
為 ,則傳回的字串是 與 屬性中包含的 Unit 字串相等 Unit 的字串。 Type如果屬性設定為任何其他 FontSize 值,則傳回的字串就是值相等的 FontSize 字串。
另請參閱
適用於
ToString(IFormatProvider)
使用指定的格式提供者,將 FontUnit 物件轉換成對等字串。
public:
System::String ^ ToString(IFormatProvider ^ formatProvider);
public string ToString (IFormatProvider formatProvider);
override this.ToString : IFormatProvider -> string
Public Function ToString (formatProvider As IFormatProvider) As String
參數
- formatProvider
- IFormatProvider
提供文化特性特定格式資訊的 IFormatProvider,在 Type 屬性被設定為 AsUnit 值時使用,否則忽略。
傳回
字串,表示這個 FontUnit,包含由 formatProvider
指定之格式的任何數字單位值。
備註
ToString使用 方法,針對字串中的任何數值,使用特定文化特性格式提供者來擷取 物件的字串表示 FontUnit 。
Type如果屬性設定為 AsUnit 值,則傳回的字串相當於 屬性中包含的 Unit 單位值。 值的數值部分 Unit 會使用指定的 formatProvider
來格式化。 換句話說,當 屬性設定為 值時 Type ,傳回的字串表示會使用 Unit.ToString(IFormatProvider) 儲存在 屬性中的 Unit 單位物件上的 方法 AsUnit 產生。
Type如果屬性設定為任何其他 FontSize 值,則傳回的字串就是值相等的 FontSize 字串。
另請參閱
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應