'Setup TextChanged flag for all textboxes For Each Control As Control In Me.Controls If Control.GetType = GetType(TextBox) Then Dim TextBox As TextBox = DirectCast(Control, TextBox) AddHandler TextBox.TextChanged, AddressOf TextBoxTextChanged_Handler MsgBox(TextBox.Name & " was changed.") 'Added this message box to see if the sub is working End If Next
' TextChangedEventHandler delegate method. Sub TextBoxTextChanged_Handler(ByVal sender As Object, ByVal e As EventArgs) Dim TextBox As TextBox = DirectCast(sender, TextBox) MsgBox(TextBox.Name & " was changed.") End Sub
InitializeComponent
Load
Controls
For Each ctl As Control In Me.Controls If ctl.GetType = GetType(GroupBox) Then For Each tb As Control in ctl.Controls '' ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)