Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overriding properties in subclasses
Message
 
To
19/07/2006 11:52:33
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01137567
Message ID:
01137685
Views:
20
Bonnie,

Thanks. That was one of the things I had tried, but that isn't the behavior I'm after. What I want is for the default value of the property to be DropDownList, but still be changeable at design-time by the developer. And if you right-click the property on the property sheet and click Reset, then I want it to be reset to DropDownList. I know this has to be possible and should be easy.

TIA,
Chad


>Chad,
>
>If you want the DropDownStyle to always be DropDownList, then set it in the constructor of the class rather
than try to override the property:
>
>using System;
>using System.Drawing;
>using System.Collections;
>using System.ComponentModel;
>using System.Windows.Forms;
>using System.Data;
>
>namespace MyCompany.WinUI.MyClasses
>{
>    public class MyComboBox : System.Windows.Forms.ComboBox
>    {
>        public MyComboBox()
>        {
>            // Override settings with new default values in the constructor.
>            this.DropDownStyle = ComboBoxStyle.DropDownList;
>        }
>    }
>}
>
>
>~~Bonnie
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform