Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
By Using Events Such as,

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox5.TextChanged, TextBox4.TextChanged, TextBox3.TextChanged, TextBox2.TextChanged

End Sub

In this event How Can I know which object is call this event.
Can U write a Example?
Thnks..
Posted
Updated 28-Dec-09 21:37pm
v3

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox5.TextChanged, TextBox4.TextChanged, TextBox3.TextChanged, TextBox2.TextChanged	
  Select Case sender.Name
  Case "TextBox1"
    // Code for TextBox1 here
  Case "TextBox2"
    // Code for TextBox2 here
  Case "TextBox3"
    // Code for TextBox3 here
  Case "TextBox4"
    // Code for TextBox4 here
  Case "TextBox5"
    // Code for TextBox5 here
  Case Else
    // Ooops!
  End Select
End Sub

:)
 
Share this answer
 
Cast the object sender to a textbox to know which textbox fired the event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900