I created a new control. Now i need it to behive in two different ways so i would like to create a new property which would be displayed in object properties list with 2 predefined values (combo box). It's easy to create a property but i'm not able to make it run with predefined default values (user can choose one but can't change it). Can anyone help?
Now i need it to behive in two different ways so i would like to create a new property which would be displayed in object properties list with 2 predefined values (combo box).
The property sheet will only show properties defined against primitive ABL datatypes (i.e. CHARACTER, INTEGER, LOGICAL, ...), not ABL reference types. And you won't be able to define your own combo-boxes.
I suggest two solutions:
1. When it's one of two values, make it a logical property. The yes/no value will be shown as a combo-box.
2. Define an Enum type in .NET (C# Express, VB.NET Express) and define the property against that type. That should show up in the property sheet (because it's a .NET reference) as a combo-box. Make sure you set your initial value in the constructor of your user control.
Thanks a lot Mike. Great answer as always. I've got Express version of C# already installed so i'll try both solutions.
Do you can write an example of solution 2, please??
Because I defined a property as class enum but dont work!! It not show up in the property sheet .
Thank you very much!!