SBendBuckeye
Programmer
Hello all,
I am wrapping an extended class in a component so that I can have a Design time presence. At Design time, how do I access the Component (Name) property (eg MyComponent1)? My extended class exposes a Name property which I want to set to the Component (Name) property when I instantiate my extended class in the Component constructor.
Thanks in advance for any ideas and/or suggestions!
I am wrapping an extended class in a component so that I can have a Design time presence. At Design time, how do I access the Component (Name) property (eg MyComponent1)? My extended class exposes a Name property which I want to set to the Component (Name) property when I instantiate my extended class in the Component constructor.
Code:
Public Class MyExtendedClass
Inherits ThirdPartyControl
Public Sub New()
MyBase.New
End Sub 'New
Public Sub New(ByVal name As String)
MyClass.New
Me.Name = name
End Sub 'New
Private m_Name As String = Nothing
Public Property Name As String
Get
Return m_Name
End Get
Set(ByVal value As String)
m_Name = value
End Set
End Property 'Name
Code:
Public Class MyComponent
Inherits System.ComponentModel.Component
Public Sub New
MyBase.New
' I want to call with my component name (eg MyComponent1).
m_MyExtendedClass = New MyExtendedClass(Me.(Name))
End Sub 'New
Private m_MyExtendedClass As MyExtendedClass
Public Property MyExtendedClass As MyExtendedClass
Get
Return m_MyExtendedClass
End Get
Set(ByVal value As MyExtendedClass)
m_MyExtendedClass = value
End Set
End Property 'MyExtendedClass