Filter property

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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
 
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
 
Back
Top