Hello everyone!
I'm translating my VB.Net application, and I need to loop through all the controls on my form. Using a recursive function such as
Public Sub TranslateControl(ByVal Ctrl As Control)
For Each ChildCtrl As Control In Ctrl.Controls
ChildCtrl.Text = Translate(ChildCtrl.Text)
If TypeOf ChildCtrl Is Label Then
CType(ChildCtrl, Label).Tag = Translate(CType(ChildCtrl, Label).Tag)
End If
TranslateControl(ChildCtrl)
Next
End Sub
works very well, but it doesn't include CommonDialog
objects, such as FolderBrowser
objects. How can I access these objects ? I tried this
For Each ChildDialog As CommonDialog In Ctrl.Controls
ChildDialog.Tag = Translate(ChildDialog.Tag)
Next
But there is obviously an inheritance problem, since CommonDialog
objects are not controls
.
Is there a way for me to loop through really all the items displayed on my form?
Thanks a lot!
CFP