I wish to allow the user of my control to choose the licensing method for the control. The choice comes from an enumeration, so they must choose one of the methods I have laid out for them. This license needs to be chosen prior to the code executing at runtime. Therefore I wish for them to selected a value at design time. Furthermore I do not wish for this property to be writable at runtime, if that can be avoided. Is there a way to make a property only available at design time?
Asked
Active
Viewed 2,375 times
3

stakx - no longer contributing
- 83,039
- 20
- 168
- 268

Pat O
- 1,344
- 3
- 12
- 27
-
I'm not completely sure, but using `System.Component.TypeDescriptor` and the related interfaces might work. – stakx - no longer contributing Feb 01 '11 at 19:24
1 Answers
5
You can give a control design-time behavior by creating a separate designer class for the control. Since the control itself can only exist as an instance of your runtime, you can't really have a property directly on it which is set only at design-time (where would it get stored?). However, designer classes are only invoked and used by the designer, so you can encapsulate non-runtime behavior there.

Bill Tür stands with Ukraine
- 3,425
- 30
- 38
- 48

Rex M
- 142,167
- 33
- 283
- 313