kwanbis
New member
- Joined
- Sep 3, 2015
- Messages
- 4
- Programming Experience
- 10+
Hello guys. I'm trying to implement an observer class where my forms are added to a list on my TranslationManager, and when the TranslationManager changes the language, all the forms change its language.
The TransLation manager is like this:
Now, the problem is that the base Form class does not has a Translate sub, so the line f.Translate(_Language) is not feasible like it is.
So my question is, how can I modify the base(?) class from where Form2 and Form3 are created so that it includes the Translate sub.
I tried something like:
Public Class myForm
Sub Translate
End Sub
End Class
But when I tell the forms that they inherit from myForm, the designer gets corrupted for that form.
Any ideas?
The TransLation manager is like this:
VB.NET:
Public Class TranslationManager
Dim ListOfForms As List(Of Form)
Public Sub RegisterForm(FormToAdd As Form)
ListOfForms.Add(FormToAdd)
End Sub
Private _Language As String
Public Property Language() As String
Get
Return _Language
End Get
Set(ByVal value As String)
If _Language <> value Then
_Language = value
For Each f In ListOfForms
f.Translate(_Language)
Next
End If
End Set
End Property
End Class
Now, the problem is that the base Form class does not has a Translate sub, so the line f.Translate(_Language) is not feasible like it is.
So my question is, how can I modify the base(?) class from where Form2 and Form3 are created so that it includes the Translate sub.
I tried something like:
Public Class myForm
Sub Translate
End Sub
End Class
But when I tell the forms that they inherit from myForm, the designer gets corrupted for that form.
Any ideas?