oApp.Labels("Company").Title_E oApp.Labels("Company").Title_F...which would return the company label in English and in French.
oApp.Labels("Company").Title
...which would then return the company label in the language of the application object, which is oApp.nLanguage.' Label class Public Class Label Private cName As String = "" Private cTitle As String = "" Private cTitle_E As String = "" Private cTitle_F As String = "" Private cTitle_S As String = "" Private cTitle_P As String = "" ' expC1 Name ' expC2 Title in English ' expC3 Title in French ' expC4 Title in Spanish ' expC5 Title in Portuguese Public Sub New(ByVal tcName As String, ByVal tcTitle_E As String, _ ByVal tcTitle_F As String, ByVal tcTitle_S As String, _ ByVal tcTitle_P As String) cName = tcName cTitle_E = tcTitle_E cTitle_F = tcTitle_F cTitle_S = tcTitle_S cTitle_P = tcTitle_P End Sub Public ReadOnly Property Name As String Get Return cName End Get End Property Public ReadOnly Property Title As String Get Dim lcTitle As String = "" Dim lnLanguage As Integer = 0 ' In the following line, I need to find a way to have oApp available here so I can get ' the nLanguage property value and return the title of the label based on it. ' lnLanguage = oApp.nLanguage ' Based on the language Select Case lnLanguage ' English Case 1 lcTitle = Title_E ' French Case 2 lcTitle = Title_F ' Spanish Case 3 lcTitle = Title_S ' Portuguese Case 4 lcTitle = Title_P End Select Return lcTitle End Get End Property Public ReadOnly Property Title_E As String Get Return cTitle_E End Get End Property Public ReadOnly Property Title_F As String Get Return cTitle_F End Get End Property Public ReadOnly Property Title_S As String Get Return cTitle_S End Get End Property Public ReadOnly Property Title_P As String Get Return cTitle_P End Get End Property End Class Public Class Labels Inherits System.Collections.Specialized.NameObjectCollectionBase Public Overloads Sub Add(ByVal Label As Label) BaseAdd(Label.Name, Label) End Sub Default Public Overloads ReadOnly Property Item(ByVal Title As String) As Label Get Return CType(BaseGet(Title), Label) End Get End Property End ClassThe problem is that I do not want to pass oApp as a parameter to this property. The goal of this is to be able to have this collection to recognize what is the current oApp.nLanguage value by itself so to return the proper string as per the language.