G
Guest
Hi
I want to make a general function for change events of the TextBoxes, ComboBoxes, Date Picker Controls etc. The problems is that when there exists controls in the GroupBox I recursively call the function. The function is as follows
Dim objCTL As Control, objRadio As RadioButton, objCheck As CheckBo
Tr
For Each objCTL In c
Select Case objCTL.GetType.ToStrin
Case "System.Windows.Forms.TextBox
AddHandler objCTL.TextChanged, AddressOf Func
Case "System.Windows.Forms.RadioButton
objRadio = objCT
AddHandler objRadio.CheckedChanged, AddressOf Func
Case "System.Windows.Forms.GroupBox"
Call EventRaiser(objCTL.Controls) ' It gives error here that the specific cast is not vaild
End Selec
Nex
Catch ex As Exceptio
End Tr
As suggested the error occurs at the Recursive call from the GroupBox case. Eventhough the Parameter passed is ControlCollection
Can anybody give me solution to this??
Thanks
Shalin Parmar
I want to make a general function for change events of the TextBoxes, ComboBoxes, Date Picker Controls etc. The problems is that when there exists controls in the GroupBox I recursively call the function. The function is as follows
Dim objCTL As Control, objRadio As RadioButton, objCheck As CheckBo
Tr
For Each objCTL In c
Select Case objCTL.GetType.ToStrin
Case "System.Windows.Forms.TextBox
AddHandler objCTL.TextChanged, AddressOf Func
Case "System.Windows.Forms.RadioButton
objRadio = objCT
AddHandler objRadio.CheckedChanged, AddressOf Func
Case "System.Windows.Forms.GroupBox"
Call EventRaiser(objCTL.Controls) ' It gives error here that the specific cast is not vaild
End Selec
Nex
Catch ex As Exceptio
End Tr
As suggested the error occurs at the Recursive call from the GroupBox case. Eventhough the Parameter passed is ControlCollection
Can anybody give me solution to this??
Thanks
Shalin Parmar