FontUnit 建構函式

定義

初始化 FontUnit 類別的新執行個體。

多載

FontUnit(Double)

使用指定的字型大小 (單位為點),初始化 FontUnit 類別的新執行個體。

FontUnit(Int32)

使用指定的字型大小,初始化 FontUnit 類別的新執行個體。

FontUnit(String)

使用指定的字串,初始化 FontUnit 類別的新執行個體。

FontUnit(FontSize)

使用指定的 FontUnit 初始化 FontSize 類別的新執行個體。

FontUnit(Unit)

使用指定的 FontUnit 初始化 Unit 類別的新執行個體。

FontUnit(Double, UnitType)

使用指定的字型大小和 FontUnit 值,初始化 UnitType 類別的新執行個體。

FontUnit(String, CultureInfo)

使用指定的字串,且該字串使用指定的 FontUnit 物件,初始化 CultureInfo 類別的新執行個體。

FontUnit(Double)

使用指定的字型大小 (單位為點),初始化 FontUnit 類別的新執行個體。

public:
 FontUnit(double value);
public FontUnit (double value);
new System.Web.UI.WebControls.FontUnit : double -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As Double)

參數

value
Double

指定字型大小的 Double

例外狀況

value 不在有效範圍内。

備註

使用 建 FontUnit 構函式,使用指定的字型大小來建立和初始化 類別的 FontUnit 實例。 下表顯示所建立物件的初始屬性值 FontUnit

屬性 初始值
Type AsUnit 值。
Unit Unit,其 Value 屬性等於 value ,且 Type 屬性等於 Point 值。

另請參閱

適用於

FontUnit(Int32)

使用指定的字型大小,初始化 FontUnit 類別的新執行個體。

public:
 FontUnit(int value);
public FontUnit (int value);
new System.Web.UI.WebControls.FontUnit : int -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As Integer)

參數

value
Int32

字型的大小。

備註

使用此建構函式,使用指定的字型大小來建立和初始化 類別的新實例 FontUnit

下表顯示 實例 FontUnit 的初始屬性值。

屬性 初始值
Type FontSize.AsUnit
Unit UnitValue 屬性設定為 參數所 value 指定的字型大小。

另請參閱

適用於

FontUnit(String)

使用指定的字串,初始化 FontUnit 類別的新執行個體。

public:
 FontUnit(System::String ^ value);
public FontUnit (string value);
new System.Web.UI.WebControls.FontUnit : string -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As String)

參數

value
String

指定字型大小的字串。

備註

FontUnit 構函式會使用 CurrentCulture 參數的 CultureInfo 屬性呼叫建構 FontUnit 函式。

另請參閱

適用於

FontUnit(FontSize)

使用指定的 FontUnit 初始化 FontSize 類別的新執行個體。

public:
 FontUnit(System::Web::UI::WebControls::FontSize type);
public FontUnit (System.Web.UI.WebControls.FontSize type);
new System.Web.UI.WebControls.FontUnit : System.Web.UI.WebControls.FontSize -> System.Web.UI.WebControls.FontUnit
Public Sub New (type As FontSize)

參數

type
FontSize

其中一個 FontSize 值。

例外狀況

指定的字型大小不是其中一個 FontSize 值。

備註

使用此建構函式,使用指定的 FontSize 物件來建立和初始化 類別的新實例 FontUnit

type如果 參數包含 值 FontSize.AsUnit ,下表會顯示 實例 FontUnit 的初始屬性值。

屬性 初始值
Type FontSize.AsUnit
Unit Unit物件,其 Value 屬性設定為 10

type如果參數包含任何其他 FontSize 值,下表會顯示 實例 FontUnit 的初始屬性值。

屬性 初始值
Type type 參數的值。
Unit Empty

另請參閱

適用於

FontUnit(Unit)

使用指定的 FontUnit 初始化 Unit 類別的新執行個體。

public:
 FontUnit(System::Web::UI::WebControls::Unit value);
public FontUnit (System.Web.UI.WebControls.Unit value);
new System.Web.UI.WebControls.FontUnit : System.Web.UI.WebControls.Unit -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As Unit)

參數

value
Unit

指定字型大小的 Unit

備註

使用此建構函式,使用指定的 Unit 來建立和初始化 類別的新實例 FontUnit

IsEmpty如果傳入 value 參數的 Unit 屬性為 true ,下表會顯示 實例 FontUnit 的初始屬性值。

屬性 初始值
Type FontSize.NotSet
Unit Empty

IsEmpty如果傳入 value 參數的 Unit 屬性為 false ,下表會顯示 實例 FontUnit 的初始屬性值。

屬性 初始值
Type FontSize.AsUnit
Unit value 參數的值。

另請參閱

適用於

FontUnit(Double, UnitType)

使用指定的字型大小和 FontUnit 值,初始化 UnitType 類別的新執行個體。

public:
 FontUnit(double value, System::Web::UI::WebControls::UnitType type);
public FontUnit (double value, System.Web.UI.WebControls.UnitType type);
new System.Web.UI.WebControls.FontUnit : double * System.Web.UI.WebControls.UnitType -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As Double, type As UnitType)

參數

value
Double

指定字型大小的 Double

type
UnitType

UnitType,指定字型大小的單位。

例外狀況

value 不在有效範圍内。

備註

使用 建 FontUnit 構函式,使用指定的字型大小和測量單位來建立和初始化 類別的 FontUnit 實例,例如點或圖元。

下表顯示 物件的初始屬性值 FontUnit

屬性 初始值
Type AsUnit 值。
Unit Unit,其 Value 屬性等於 valueType 且 屬性等於 type

另請參閱

適用於

FontUnit(String, CultureInfo)

使用指定的字串,且該字串使用指定的 FontUnit 物件,初始化 CultureInfo 類別的新執行個體。

public:
 FontUnit(System::String ^ value, System::Globalization::CultureInfo ^ culture);
public FontUnit (string value, System.Globalization.CultureInfo culture);
new System.Web.UI.WebControls.FontUnit : string * System.Globalization.CultureInfo -> System.Web.UI.WebControls.FontUnit
Public Sub New (value As String, culture As CultureInfo)

參數

value
String

指定字型大小的字串。

culture
CultureInfo

用來比較字串的 CultureInfo

備註

FontUnit 構函式會辨識下表所示的字串 value ,以建立 類別的新實例 FontUnit

字串值 FontUnit
xx-small, xxsmall XXSmall
x-small, xsmall XSmall
x-large, xlarge XLarge
xx-large, xxlarge XXLarge
small Small
smaller Smaller
large Large
larger Larger
medium Medium

在所有情況下, Type 屬性都有 值 NotSet 。 字串比較不區分大小寫。

針對 的所有其他值 value ,系統會將 類別的新實例 FontUnit 視為 value 字型大小,並將 屬性設定 TypePoint 來建立。

另請參閱

適用於