PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Easier way to expose properties?
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Easier way to expose properties?
![]() |
Easier way to expose properties? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am using some 3rd party controls to create my own control.
I want to "pass up" many (but not all) of the properties of the 3rd party controls that I am using to make my control, so that the end user can customize as much or as little as they wish. But, there are HUNDREDS of properties (of the combined controls). Is there an easy way to expose the properties of the controls that I am using to make my control adn still be able to block the very few properties that (if set wrong) may make my control act up? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
The first solution (politically correct) would be to provide accessors
to all the interested properties. The second solution (also politcially correct) would be to subclass the original component and hide the properties you don't want. There is also a third solution, but it's a bit hackish ... By using reflection you can create a method SetProperty(string name, object value) and set the values of the properties. There you can check for properties you don't want to change. Regards, Tasos |
|
|
|
#3 |
|
Guest
Posts: n/a
|
what is wrong with
myComponent.MySubComponent.Property = newValue; This way you do not need to program the properties again. There also might be tools/codegenerators which might be able to automatize the generation of properties for you. If not, you can easily generate a code generator by yourself using reflection. -- "ljh" <Some@where.else> schrieb im Newsbeitrag news:_xVbg.41011$QU3.12460@bignews8.bellsouth.net... >I am using some 3rd party controls to create my own control. > > I want to "pass up" many (but not all) of the properties of the 3rd party > controls that I am using to make my control, so that the end user can > customize as much or as little as they wish. But, there are HUNDREDS of > properties (of the combined controls). > > Is there an easy way to expose the properties of the controls that I am > using to make my control adn still be able to block the very few > properties that (if set wrong) may make my control act up? > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

