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.

eg:
Public property let Formname(f as object)
....code
end property

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

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

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
0
 
PaulrajAuthor Commented:
Please notify me at my mail address.
0
 
VbmasterCommented:
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.
0
All Courses

From novice to tech pro — start learning today.