I have employed a "Singleton mode" of programming for this project.
I have a class that exposes some properties of the class "Sample" to other
forms....
If I set Option Strict On, I get many "Option Strict On disallows late
binding" errors (see below)
How might I fix this ?
Public Class Sample
Private Shared DInstance As Sample = Nothing
Private Sub New()
' This call is required by the Windows Form Designer.
InitializeCompo nent()
' Add any initialization after the InitializeCompo nent() call.
End Sub
Public Shared ReadOnly Property Instance()
Get
If (DInstance Is Nothing) Then DInstance = New Sample()
Return DInstance
End Get
End Property
Public Property TabControlAvail able() As TabControl
Get
Return Me.TabControl1
End Get
Set(ByVal value As TabControl)
Me.TabControl1 = value
End Set
End Property
Public Property SelectedTabAvai lable() As TabPage
Get
Return Me.TabControl1. SelectedTab
End Get
Set(ByVal value As TabPage)
Me.TabControl1. SelectedTab = value
End Set
End Property
' These are the rows where the errors are pointing to...
Sample.Instance .Visible = True
Sample.Instance .TopMost = True
Sample.Instance .TabControlAvai lable.SelectTab (strTabPageName )
Sample.Instance .Show()
I have a class that exposes some properties of the class "Sample" to other
forms....
If I set Option Strict On, I get many "Option Strict On disallows late
binding" errors (see below)
How might I fix this ?
Public Class Sample
Private Shared DInstance As Sample = Nothing
Private Sub New()
' This call is required by the Windows Form Designer.
InitializeCompo nent()
' Add any initialization after the InitializeCompo nent() call.
End Sub
Public Shared ReadOnly Property Instance()
Get
If (DInstance Is Nothing) Then DInstance = New Sample()
Return DInstance
End Get
End Property
Public Property TabControlAvail able() As TabControl
Get
Return Me.TabControl1
End Get
Set(ByVal value As TabControl)
Me.TabControl1 = value
End Set
End Property
Public Property SelectedTabAvai lable() As TabPage
Get
Return Me.TabControl1. SelectedTab
End Get
Set(ByVal value As TabPage)
Me.TabControl1. SelectedTab = value
End Set
End Property
' These are the rows where the errors are pointing to...
Sample.Instance .Visible = True
Sample.Instance .TopMost = True
Sample.Instance .TabControlAvai lable.SelectTab (strTabPageName )
Sample.Instance .Show()
Comment