LiteralControl.Text 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定物件的 LiteralControl 文字內容。
public:
virtual property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
public virtual string Text { get; set; }
member this.Text : string with get, set
Public Overridable Property Text As String
屬性值
String A 代表字面控制的文字內容。 預設值為 Empty。
實作
範例
以下程式碼範例建立一個類別, CustLiteralControlClass該類別擴展該 LiteralControl 類別。 它會使用未指定物件文本myLiteralControlClass1的建構子,建立一個被命名LiteralControl的類別實例。 物件建立後, Text 該屬性用來設定其所包含的文字。
CustomLiteralControlClass myLiteralControlClass1=
new CustomLiteralControlClass();
myLiteralControlClass1.Text="This Control demonstrates the constructor1";
Dim myLiteralControlClass1 as CustomLiteralControlClass = _
new CustomLiteralControlClass()
myLiteralControlClass1.Text="This Control demonstrates the constructor1"