Share via


FontUnit.ToString 方法

定义

FontUnit 对象转换为字符串表示形式。

重载

ToString()

FontUnit 对象转换为默认的字符串表示形式。

ToString(CultureInfo)

使用指定的 FontUnitCultureInfo 对象转换为字符串表示形式。

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)

使用指定的 FontUnitCultureInfo 对象转换为字符串表示形式。

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 字符串。

另请参阅

适用于