I have a form were there a number of textboxes which are created on a form dynamically, the number of which varies according to initial parameters.
Due to the nature of data that the user has to input the text must be formatted to a set format on the 'textbox.leave' event
the attached code works perfectly for this textbox as there is no requirement for information from the textbox that raised the event. Is there some way to use a method like the 'Directcast()' method to obtain properties from the textbox which triggered the event?
'' This code in in the form.load eventArg after the code that creates the synamic textboxes
For Each ctl As Control In Me.Controls
If TypeOf ctl Is TextBox Then
AddHandler ctl.Leave, AddressOf tbleave
MessageBox.Show("The user has left this textbox")