New control property with default values

Posted by vrtik on 12-Jul-2010 04:58

Hi all

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?

Thanks

Peter

All Replies

Posted by Admin on 12-Jul-2010 06:14

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.

Posted by vrtik on 12-Jul-2010 07:07

Thanks a lot Mike. Great answer as always. I've got Express version of C# already installed so i'll try both solutions.

Posted by Elena_Perello on 27-Sep-2013 04:27

Hi!!

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!!

This thread is closed