Edit

Share via


FontUnit.ToString Method

Definition

Converts the FontUnit object to a string representation.

Overloads

ToString()

Converts the FontUnit object to the default string representation.

ToString(CultureInfo)

Converts the FontUnit object to a string representation, using the specified CultureInfo.

ToString(IFormatProvider)

Converts a FontUnit object to a string equivalent using the specified format provider.

ToString()

Converts the FontUnit object to the default string representation.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Returns

The string representation of the FontUnit object.

Remarks

Use the ToString method to retrieve the string representation of the FontUnit. If the Type property is set to FontSize.AsUnit, the returned string is the string equivalent of the Unit contained in the Unit property. If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

Applies to

ToString(CultureInfo)

Converts the FontUnit object to a string representation, using the specified 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

Parameters

culture
CultureInfo

A CultureInfo that contains the culture to represent the FontUnit.

Returns

The string representation of the FontUnit object in the specified culture.

Remarks

Use the ToString method to retrieve the string representation of the FontUnit in the specified culture. If the Type property is set to FontSize.AsUnit, the returned string is the string equivalent of the Unit contained in the Unit property. If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

Applies to

ToString(IFormatProvider)

Converts a FontUnit object to a string equivalent using the specified format provider.

public:
 System::String ^ ToString(IFormatProvider ^ formatProvider);
public string ToString (IFormatProvider formatProvider);
override this.ToString : IFormatProvider -> string
Public Function ToString (formatProvider As IFormatProvider) As String

Parameters

formatProvider
IFormatProvider

An IFormatProvider that supplies culture-specific formatting information, which is used if the Type property is set to the AsUnit value; otherwise, it is ignored.

Returns

A string that represents this FontUnit, with any numeric unit value in the format specified by formatProvider.

Remarks

Use the ToString method to retrieve the string representation of the FontUnit object using a culture-specific format provider for any numeric values that are in the string.

If the Type property is set to the AsUnit value, the returned string is the string equivalent of the unit value that is contained in the Unit property. The numeric portion of the Unit value is formatted using the specified formatProvider. In other words, when the Type property is set to the AsUnit value, the returned string representation is generated using the Unit.ToString(IFormatProvider) method on the unit object that is stored in the Unit property.

If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

Applies to