共用方式為


IEditableTextControl.TextChanged 事件

定義

發生於文字內容在公佈至伺服器期間時變更。

public:
 event EventHandler ^ TextChanged;
event EventHandler TextChanged;
member this.TextChanged : EventHandler 
Event TextChanged As EventHandler 

事件類型

範例

下列程式碼範例示範 事件的實作 TextChanged


public partial class customeditablebox : System.Web.UI.UserControl, IEditableTextControl
{
    private static readonly object EventCustomTextChanged = new Object();

    public event EventHandler TextChanged
    {
        add
        {
            Events.AddHandler(EventCustomTextChanged, value);
        }
        remove
        {
            Events.RemoveHandler(EventCustomTextChanged, value);
        }
    }

    public string Text
    {
        get
        {
            // Provide implementation.
            return String.Empty;
        }
        set
        {
            // Provide implementation.
        }
    }
}
Public Class customeditablebox
    Inherits System.Web.UI.UserControl
    Implements System.Web.UI.IEditableTextControl

    Private Shared ReadOnly EventCustomTextChanged As New Object

    Public Custom Event TextChanged As EventHandler _
      Implements System.Web.UI.IEditableTextControl.TextChanged
        AddHandler(ByVal value As EventHandler)
            Events.AddHandler(EventCustomTextChanged, value)
        End AddHandler

        RemoveHandler(ByVal value As EventHandler)
            Events.RemoveHandler(EventCustomTextChanged, value)
        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)

        End RaiseEvent
    End Event

    Public Property Text() As String _
      Implements System.Web.UI.IEditableTextControl.Text
        Get
            ' Provide implementation.
            Return String.Empty
        End Get
        Set(ByVal value As String)
            ' Provide implementation.
        End Set
    End Property
End Class

備註

TextChanged 屬性在貼文到伺服器之間變更時 Text ,就會發生此事件。 您可以在 或 控制項中找到 TextBox 這個事件的實作 ListControl

適用於