G
Guest
I have a user control and it has a textbox. I added it to form. But i can't use the textbox's events on form. How can i do it? Pls help me.
can't use the textbox's events on form. How can i do it? Pls help me.Erencan said:I have a user control and it has a textbox. I added it to form. But i
Ken Tucker said:Hi,
You will have to raise the events your self when the textchanges.
Here is a simple example.
Public Class UserControl1
Inherits System.Windows.Forms.UserControl
#Region " Windows Form Designer generated code "
Public Shadows Event TextChanged(ByVal sender As Object, ByVal e As
EventArgs)
Public Shadows Property Text() As String
Get
Return TextBox1.Text
End Get
Set(ByVal Value As String)
TextBox1.Text = Value
End Set
End Property
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
RaiseEvent TextChanged(Me, e)
End Sub
End Class
Ken