IEditableTextControl.TextChanged 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当文本的内容在向服务器的发送操作之间更改时发生。
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 发到服务器的帖子之间发生更改时,会发生 该事件。 可以在 或 ListControl 控件中找到TextBox此事件的实现。