Activex Control

Iam creating an UserControl and added a property which is of object type. After compling,the property is not displayed in Property window, instead I get in Run-time.

Public property let Formname(f as object)
end property

Now, this property is not visible in property window but at runtime available.

I want it in property window.
Who is Participating?
turboelfConnect With a Mentor Commented:

Because your property is an object type you need to use the "Set" statement as opposed to the "Let" statement.

You also need to assign your variables using a "Set objectname = object"

In this example you want to expose the Label1's Font Property as a Font Property for your user control

Public Property Get Font() As Font
    Set Font = Label1.Font
End Property

Public Property Set Font(ByVal New_Font As Font)
    Set Label1.Font = New_Font
    PropertyChanged "Font"
End Property
PaulrajAuthor Commented:
Please notify me at my mail address.
Since this value can't be edited by the user in the IDE, you can't just type "frmMain" for example to get the object frmMain. Because of this the object won't show up in the property window.
All Courses

From novice to tech pro — start learning today.