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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
turboelfCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.