User Control Events by:Anonymous
|
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.
|
| | Reply: by:Ken Tucker [MVP]
|
| | 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
|
| | Reply: by:WStoreyII
|
| | what does the shadow Term do ken?
WSToreyII
|
| | Reply: by:Ken Tucker [MVP]
|
| | Hi,
It allows you to overload something that is not set up to be overloaded. See the article below for a good explaination.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet12252001.asp Ken
|
0 Comments:
Post a Comment
<< Home