Hi,
I’m trying to use a class that’s created in an ocx. For the post I created a small sample project which is as following:
A ocx project called: Project1
class module called: Class1
Option Explicit
Private mStategroup As String
Public Property Get Stategroup() As String
Stategroup = mStategroup
End Property
Public Property Let Stategroup(ByVal lNewValue As String)
mStategroup = lNewValue
End Property
I created a visual basic project called: Project1
I inserted the ocx in the components tab of the vb project and placed this on the form.
On the form I placed 1 button and used this code:
Private Sub Command1_Click()
Dim test As Project1.Class1
Set test = New Class1
test.Stategroup = "test"
End Sub
When I now run the project I get the following message “invalid use of New keyword”
If you could help me???
Thanx!!!!!!
I’m trying to use a class that’s created in an ocx. For the post I created a small sample project which is as following:
A ocx project called: Project1
class module called: Class1
Option Explicit
Private mStategroup As String
Public Property Get Stategroup() As String
Stategroup = mStategroup
End Property
Public Property Let Stategroup(ByVal lNewValue As String)
mStategroup = lNewValue
End Property
I created a visual basic project called: Project1
I inserted the ocx in the components tab of the vb project and placed this on the form.
On the form I placed 1 button and used this code:
Private Sub Command1_Click()
Dim test As Project1.Class1
Set test = New Class1
test.Stategroup = "test"
End Sub
When I now run the project I get the following message “invalid use of New keyword”
If you could help me???
Thanx!!!!!!