I am working on a new assignment. Our instructor wants us to code a shared leave event for three textboxes (txtBox1, txtBox2, txtBox3).
I understand how to code the shared event and how to make a generic tbox for it:
Private Sub txtDescription_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBox1.Leave, txtBox2.Leave, txtBox3.Leave
'generic textbox
Dim txtText As TextBox
txtText = CType(sender, TextBox)
We are told that if the generic textbox contains data and the data has been modified (against the database record), we need to :
Determine the name (name property) of the textbox that casued the evend
and
Determine the value (text property) of that textbox.
I know to check to see if anything is in the generic box by the length property, and if it is modified by the modified method, but how do you determine the name and value? Is it a case statement?
You have everything that you need right there. The sender Object is the
TextBoxthat is triggering the event