Filter property

G

Guest

I create a component which a property of type Control. In property window i
liked list in combobox only Label and LinkLabel. How do this?
 
P

Peter Foot [MVP]

Why not make the type of your property Label since LinkLabel is derived from
Label. I haven't tried it but in theory this will allow you to choose from
any control derived from Label. If this doesn't work you would need to
create your own custom designer and write this functionality.

Peter
 
G

Guest

In OpenNETCF, LinkLabel is derived of Control.

Peter Foot said:
Why not make the type of your property Label since LinkLabel is derived from
Label. I haven't tried it but in theory this will allow you to choose from
any control derived from Label. If this doesn't work you would need to
create your own custom designer and write this functionality.

Peter
 
P

Peter Foot [MVP]

Another option would be to add some logic to your property setter so that if
the control assigned isn't of the required type you set it to null (Nothing
in VB). This won't stop the designer from showing all controls, but it will
stop you from assigning an invalid one.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top